当前位置: 首页>>代码示例>>PHP>>正文


PHP PropertyTable::getEntity方法代码示例

本文整理汇总了PHP中Bitrix\Iblock\PropertyTable::getEntity方法的典型用法代码示例。如果您正苦于以下问题:PHP PropertyTable::getEntity方法的具体用法?PHP PropertyTable::getEntity怎么用?PHP PropertyTable::getEntity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bitrix\Iblock\PropertyTable的用法示例。


在下文中一共展示了PropertyTable::getEntity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: create

 /**
  * @inheritdoc
  */
 public function create(ParameterDictionary $parameters)
 {
     $iblockId = (int) $parameters->get('ID');
     $queryBuilder = new Entity\Query(Iblock\IblockTable::getEntity());
     $iblockData = $queryBuilder->setSelect(array('ID', 'NAME'))->setFilter(array('ID' => $iblockId))->setOrder(array())->exec()->fetch();
     if (empty($iblockData)) {
         throw new BuilderException(sprintf('Not found iblock with id = %d', $iblockId));
     }
     // Get settings iblock
     $iblockDataFields = \CIBlock::GetArrayByID($iblockData['ID']);
     $queryBuilder = new Entity\Query(Iblock\PropertyTable::getEntity());
     $propertyResult = $queryBuilder->setSelect(array('*'))->setFilter(array('IBLOCK_ID' => $iblockData['ID']))->setOrder(array())->exec();
     $propertyList = array();
     while ($property = $propertyResult->fetch()) {
         if (!empty($property['USER_TYPE_SETTINGS'])) {
             $property['USER_TYPE_SETTINGS'] = ($unserialize = @unserialize($property['USER_TYPE_SETTINGS'])) === false ? $property['USER_TYPE_SETTINGS'] : $unserialize;
         }
         $propertyList[$property['CODE']] = $property;
     }
     $this->iblockProperty = $propertyList;
     $this->setElementValue();
     $this->setSectionValue();
     $this->setEnumValue();
     $sectionValueList = array();
     if (in_array($iblockData['ID'], $this->getListByType('G'))) {
         foreach ($this->iblockProperty as $field) {
             if ($field['PROPERTY_TYPE'] == 'G' && $field['LINK_IBLOCK_ID'] == $iblockData['ID']) {
                 $sectionValueList = isset($field['VALUE_LIST']) ? $field['VALUE_LIST'] : array();
                 break;
             }
         }
     } else {
         $queryBuilder = new Entity\Query(Iblock\SectionTable::getEntity());
         $sectionValueList = $queryBuilder->setSelect(array('ID', 'NAME'))->setFilter(array('IBLOCK_ID' => $iblockData['ID']))->setOrder(array())->exec()->fetchAll();
     }
     $upperLevel[] = array('ID' => 0, 'NAME' => GetMessage('IBLOCK_UPPER_LEVEL'));
     $sectionValueList = $upperLevel + $sectionValueList;
     return array('DATA' => $iblockData, 'DEFAULT_FIELDS' => $this->getDefaultFields($iblockDataFields, $sectionValueList), 'FIELDS' => $this->iblockProperty);
 }
开发者ID:ASDAFF,项目名称:citfact.form,代码行数:42,代码来源:IBlockBuilder.php

示例2: parse

 /**
  * Parses the filter, we describe the properties of the
  * filter type and description price
  *
  * @return $this
  */
 public function parse()
 {
     if (sizeof($this->filterList) <= 0) {
         return array();
     }
     $property = $price = array();
     foreach ($this->filterList as $key => $items) {
         foreach ($items as $filterQuery => $filterValue) {
             if (preg_match($this->pattern['property'], $filterQuery, $match)) {
                 $property[] = $match[2];
             } elseif (preg_match($this->pattern['price'], $filterQuery, $match)) {
                 $price[] = $match[2];
             }
             if (is_array($match)) {
                 unset($this->filterList[$key][$filterQuery]);
                 $this->filterList[$key][$match[1]] = $filterValue;
             }
         }
     }
     if (sizeof($property)) {
         $queryBuilder = new Entity\Query(Iblock\PropertyTable::getEntity());
         $propertyResult = $queryBuilder->setSelect(array('*'))->setFilter(array('ID' => $property))->exec();
         while ($property = $propertyResult->fetch()) {
             $key = sprintf('PROPERTY_%d', $property['ID']);
             $this->propertyList[$key] = $property;
         }
     }
     if (sizeof($price)) {
         $priceTypeResult = \CCatalogGroup::GetList(array('SORT' => 'ASC'), array('ID' => $price));
         while ($price = $priceTypeResult->Fetch()) {
             $key = sprintf('CATALOG_PRICE_%d', $price['ID']);
             $this->priceTypeList[$key] = $price;
         }
     }
     $this->getValueList();
     return $this;
 }
开发者ID:ASDAFF,项目名称:citfact.filter.subscribe,代码行数:43,代码来源:FilterLexer.php

示例3: array

        $navyParams['PAGEN'] = (int) $navyParams['PAGEN'];
        $navyParams['SIZEN'] = (int) $navyParams['SIZEN'];
    }
}
if ($selectFields['PROPERTY_TYPE']) {
    $selectFields['USER_TYPE'] = true;
}
$selectFields = array_keys($selectFields);
$getListParams = array('select' => $selectFields, 'filter' => $arFilter, 'order' => $propertyOrder);
if ($usePageNavigation) {
    $getListParams['limit'] = $navyParams['SIZEN'];
    $getListParams['offset'] = $navyParams['SIZEN'] * ($navyParams['PAGEN'] - 1);
}
$totalPages = 0;
if ($usePageNavigation) {
    $countQuery = new Main\Entity\Query(Iblock\PropertyTable::getEntity());
    $countQuery->addSelect(new Main\Entity\ExpressionField('CNT', 'COUNT(1)'));
    $countQuery->setFilter($getListParams['filter']);
    $totalCount = $countQuery->setLimit(null)->setOffset(null)->exec()->fetch();
    unset($countQuery);
    $totalCount = (int) $totalCount['CNT'];
    if ($totalCount > 0) {
        $totalPages = ceil($totalCount / $navyParams['SIZEN']);
        if ($navyParams['PAGEN'] > $totalPages) {
            $navyParams['PAGEN'] = $totalPages;
        }
        $getListParams['limit'] = $navyParams['SIZEN'];
        $getListParams['offset'] = $navyParams['SIZEN'] * ($navyParams['PAGEN'] - 1);
    } else {
        $navyParams['PAGEN'] = 1;
        $getListParams['limit'] = $navyParams['SIZEN'];
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:iblock_property_admin.php


注:本文中的Bitrix\Iblock\PropertyTable::getEntity方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。