本文整理汇总了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);
}
示例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;
}
示例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'];