本文整理汇总了PHP中Bitrix\Iblock\PropertyTable::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP PropertyTable::getList方法的具体用法?PHP PropertyTable::getList怎么用?PHP PropertyTable::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bitrix\Iblock\PropertyTable
的用法示例。
在下文中一共展示了PropertyTable::getList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testExistsReferencesRegister
public function testExistsReferencesRegister()
{
Module::getInstance()->install();
$dbRsRef = DbVersionReferencesTable::getList(array('filter' => array('GROUP' => ReferenceController::GROUP_IBLOCK)));
$dbRsIblock = IblockTable::getList();
$this->assertEquals($dbRsIblock->getSelectedRowsCount(), $dbRsRef->getSelectedRowsCount(), $this->errorMessage('number of links to the information block and the information block entries must match'));
$dbRsRef = DbVersionReferencesTable::getList(array('filter' => array('GROUP' => ReferenceController::GROUP_IBLOCK_PROPERTY)));
$dbRsProp = PropertyTable::getList();
$this->assertEquals($dbRsProp->getSelectedRowsCount(), $dbRsRef->getSelectedRowsCount(), $this->errorMessage('number of links on the properties of information blocks and records must match'));
$dbRsRef = DbVersionReferencesTable::getList(array('filter' => array('GROUP' => ReferenceController::GROUP_IBLOCK_SECTION)));
$dbRsSection = SectionTable::getList();
$this->assertEquals($dbRsSection->getSelectedRowsCount(), $dbRsRef->getSelectedRowsCount(), $this->errorMessage('number of links to information block sections and records must match'));
}
示例2: testReinitIblockReference
public function testReinitIblockReference()
{
$beforeApplyFix = array('iblocks' => IblockTable::getList()->getSelectedRowsCount(), 'properties' => PropertyTable::getList()->getSelectedRowsCount(), 'sections' => SectionTable::getList()->getSelectedRowsCount());
$collector = Collector::createByFile(__DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'fixtures' . DIRECTORY_SEPARATOR . 'add_collection.json');
$this->assertNotEmpty($collector->getFixes());
Module::getInstance()->applyFixesList($collector->getFixes());
$afterApplyFix = array('iblocks' => IblockTable::getList()->getSelectedRowsCount(), 'properties' => PropertyTable::getList()->getSelectedRowsCount(), 'sections' => SectionTable::getList()->getSelectedRowsCount());
Module::getInstance()->rollbackLastChanges();
$afterRollback = array('iblocks' => IblockTable::getList()->getSelectedRowsCount(), 'properties' => PropertyTable::getList()->getSelectedRowsCount(), 'sections' => SectionTable::getList()->getSelectedRowsCount());
Module::getInstance()->applyFixesList($collector->getFixes());
$afterRollbackApply = array('iblocks' => IblockTable::getList()->getSelectedRowsCount(), 'properties' => PropertyTable::getList()->getSelectedRowsCount(), 'sections' => SectionTable::getList()->getSelectedRowsCount());
$this->assertEquals($beforeApplyFix['iblocks'], $afterApplyFix['iblocks'] - 1, $this->errorMessage('iblock not created after apply fix'));
$this->assertEquals($beforeApplyFix['properties'], $afterApplyFix['properties'] - 2, $this->errorMessage('properties not created after apply fix'));
$this->assertEquals($beforeApplyFix['sections'], $afterApplyFix['sections'] - 1, $this->errorMessage('sections not created after apply fix'));
$this->assertEquals($beforeApplyFix['iblocks'], $afterRollback['iblocks'], $this->errorMessage('iblock not removed after rollback fix'));
$this->assertEquals($beforeApplyFix['properties'], $afterRollback['properties'], $this->errorMessage('properties not removed after rollback fix'));
$this->assertEquals($beforeApplyFix['sections'], $afterRollback['sections'], $this->errorMessage('sections not removed after rollback fix'));
$this->assertEquals($afterRollback['iblocks'] + 1, $afterRollbackApply['iblocks'], $this->errorMessage('iblock not created after apply rollback fix'));
$this->assertEquals($afterRollback['properties'] + 2, $afterRollbackApply['properties'], $this->errorMessage('properties not created after apply rollback fix'));
$this->assertEquals($afterRollback['sections'] + 1, $afterRollbackApply['sections'], $this->errorMessage('sections not created after apply rollback fix'));
}
示例3: getProductByProps
function getProductByProps($iblockID, $arSkuProps, $extMode = false)
{
$extMode = $extMode === true;
$result = false;
$arOfFilter = array("IBLOCK_ID" => $iblockID);
$directoryList = array();
$propertyIterator = Iblock\PropertyTable::getList(array('select' => array('ID', 'CODE', 'PROPERTY_TYPE', 'USER_TYPE', 'USER_TYPE_SETTINGS', 'XML_ID'), 'filter' => array('IBLOCK_ID' => $iblockID, 'ACTIVE' => 'Y', '=PROPERTY_TYPE' => array(Iblock\PropertyTable::TYPE_ELEMENT, Iblock\PropertyTable::TYPE_LIST, Iblock\PropertyTable::TYPE_STRING)), 'order' => array('SORT' => 'ASC', 'ID' => 'ASC')));
while ($property = $propertyIterator->fetch()) {
$property['CODE'] = (string) $property['CODE'];
if ($property['CODE'] == '') {
$property['CODE'] = $property['ID'];
}
if (!isset($arSkuProps[$property['CODE']])) {
continue;
}
if ($property['PROPERTY_TYPE'] == Iblock\PropertyTable::TYPE_LIST) {
$arOfFilter['PROPERTY_' . $property['ID'] . '_VALUE'] = $arSkuProps[$property['CODE']];
} elseif ($property['PROPERTY_TYPE'] == Iblock\PropertyTable::TYPE_ELEMENT) {
$arOfFilter['PROPERTY_' . $property['ID']] = $arSkuProps[$property['CODE']];
} elseif ($property['PROPERTY_TYPE'] == Iblock\PropertyTable::TYPE_STRING && $property['USER_TYPE'] == 'directory') {
$arOfFilter['PROPERTY_' . $property['ID']] = $arSkuProps[$property['CODE']];
if (!empty($property['USER_TYPE_SETTINGS'])) {
$directoryList[$property['ID']] = $property;
}
}
}
$rsOffers = CIBlockElement::GetList(array(), $arOfFilter, false, false, array('ID', 'IBLOCK_ID', 'IBLOCK_SECTION_ID', 'XML_ID'));
if ($arOffer = $rsOffers->Fetch()) {
$result = $extMode ? $arOffer : $arOffer['ID'];
} elseif (!empty($directoryList) && Loader::includeModule('highloadblock')) {
$newSearch = false;
foreach ($directoryList as &$property) {
if (!CheckSerializedData($property['USER_TYPE_SETTINGS'])) {
continue;
}
$property['USER_TYPE_SETTINGS'] = unserialize($property['USER_TYPE_SETTINGS']);
if (empty($property['USER_TYPE_SETTINGS']['TABLE_NAME'])) {
continue;
}
$hlblock = HL\HighloadBlockTable::getList(array('filter' => array('=TABLE_NAME' => $property['USER_TYPE_SETTINGS']['TABLE_NAME'])))->fetch();
if ($hlblock) {
$value = $arOfFilter['PROPERTY_' . $property['ID']];
$entity = HL\HighloadBlockTable::compileEntity($hlblock);
$entityDataClass = $entity->getDataClass();
$dataIterator = $entityDataClass::getList(array('select' => array('ID', 'UF_NAME', 'UF_XML_ID'), 'filter' => array(array('LOGIC' => 'OR', '=UF_XML_ID' => $value, '=UF_NAME' => $value))));
while ($data = $dataIterator->fetch()) {
if ($data['UF_XML_ID'] == $value) {
break;
}
if ($data['UF_NAME'] == $value) {
$arOfFilter['PROPERTY_' . $property['ID']] = $data['UF_XML_ID'];
$newSearch = true;
break;
}
}
unset($data, $dataIterator, $entityDataClass, $entity);
}
unset($hlblock);
}
unset($property);
if ($newSearch) {
$rsOffers = CIBlockElement::GetList(array(), $arOfFilter, false, false, array('ID', 'IBLOCK_ID', 'IBLOCK_SECTION_ID', 'XML_ID'));
if ($arOffer = $rsOffers->Fetch()) {
$result = $extMode ? $arOffer : $arOffer['ID'];
}
}
}
return $result;
}
示例4: unset
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'];
$getListParams['offset'] = 0;
}
}
$propertyIterator = new CAdminResult(Iblock\PropertyTable::getList($getListParams), $sTableID);
if ($usePageNavigation) {
$propertyIterator->NavStart($getListParams['limit'], $navyParams['SHOW_ALL'], $navyParams['PAGEN']);
$propertyIterator->NavRecordCount = $totalCount;
$propertyIterator->NavPageCount = $totalPages;
$propertyIterator->NavPageNomer = $navyParams['PAGEN'];
} else {
$propertyIterator->NavStart();
}
$lAdmin->NavText($propertyIterator->GetNavPrint(GetMessage("IBP_ADM_PAGER")));
while ($property = $propertyIterator->Fetch()) {
$property['ID'] = (int) $property['ID'];
$property['USER_TYPE'] = (string) $property['USER_TYPE'];
if ($property['USER_TYPE'] != '') {
$property['PROPERTY_TYPE'] .= ':' . $property['USER_TYPE'];
}
示例5: array
$arSProperty_LNS[$FIELD_NAME] = $arProperty_UF[$FIELD_NAME];
}
unset($arUserFields);
}
$offers = false;
$arProperty_Offers = array();
$arProperty_OffersWithoutFile = array();
if ($catalogIncluded && $iblockExists)
{
$offers = CCatalogSKU::GetInfoByProductIBlock($arCurrentValues['IBLOCK_ID']);
if (!empty($offers))
{
$propertyIterator = Iblock\PropertyTable::getList(array(
'select' => array('ID', 'IBLOCK_ID', 'NAME', 'CODE', 'PROPERTY_TYPE', 'MULTIPLE', 'LINK_IBLOCK_ID', 'USER_TYPE'),
'filter' => array('=IBLOCK_ID' => $offers['IBLOCK_ID'], '=ACTIVE' => 'Y', '!=ID' => $offers['SKU_PROPERTY_ID']),
'order' => array('SORT' => 'ASC', 'NAME' => 'ASC')
));
while ($property = $propertyIterator->fetch())
{
$propertyCode = (string)$property['CODE'];
if ($propertyCode == '')
$propertyCode = $property['ID'];
$propertyName = '['.$propertyCode.'] '.$property['NAME'];
$arProperty_Offers[$propertyCode] = $propertyName;
if ($property['PROPERTY_TYPE'] != Iblock\PropertyTable::TYPE_FILE)
$arProperty_OffersWithoutFile[$propertyCode] = $propertyName;
}
unset($propertyCode, $propertyName, $property, $propertyIterator);
}
示例6: setFields
public function setFields(array $fields)
{
parent::setFields($fields);
if (is_array($this->fields) && $this->iblock_id > 0) {
$properties = array();
$propertyList = \Bitrix\Iblock\PropertyTable::getList(array("select" => array("*"), "filter" => array("=IBLOCK_ID" => $this->iblock_id)));
while ($row = $propertyList->fetch()) {
if ($row["USER_TYPE_SETTINGS"]) {
$row["USER_TYPE_SETTINGS"] = unserialize($row["USER_TYPE_SETTINGS"]);
}
$properties[$row["ID"]] = $row;
if ($row["CODE"] != "") {
$properties[$row["CODE"]] =& $properties[$row["ID"]];
}
}
foreach ($fields as $propertyCode => $propertyValues) {
if (is_array($propertyValues)) {
foreach ($propertyValues as $i => $propertyValue) {
if (is_array($propertyValue) && array_key_exists("VALUE", $propertyValue)) {
if ($propertyValue["VALUE"] != "") {
$propertyValues[$i] = $propertyValue["VALUE"];
} else {
unset($propertyValues[$i]);
}
}
}
}
if (isset($properties[$propertyCode])) {
$property = $properties[$propertyCode];
$fieldCode = strtolower($propertyCode);
if ($property["PROPERTY_TYPE"] === "L") {
if (is_numeric($propertyValues)) {
$value = new ElementPropertyEnum($propertyValues);
} elseif (is_array($propertyValues)) {
$value = array();
foreach ($propertyValues as $propertyValue) {
if (is_numeric($propertyValue)) {
$value[] = new ElementPropertyEnum($propertyValue);
}
}
} else {
$value = $propertyValues;
}
} elseif ($property["PROPERTY_TYPE"] === "E") {
if ($propertyValues instanceof Element) {
$this->element_link_properties[$fieldCode] = $propertyValues;
$value = $propertyValues->getField("name");
} elseif (is_numeric($propertyValues)) {
$this->element_link_properties[$fieldCode] = $propertyValues;
$value = new ElementPropertyElement($propertyValues);
} else {
$value = $propertyValues;
}
} elseif ($property["PROPERTY_TYPE"] === "G") {
if ($propertyValues instanceof Section) {
$this->section_link_properties[$fieldCode] = $propertyValues;
$value = $propertyValues->getField("name");
} elseif (is_numeric($propertyValues)) {
$this->section_link_properties[$fieldCode] = $propertyValues;
$value = new ElementPropertySection($propertyValues);
} else {
$value = $propertyValues;
}
} else {
if (strlen($property["USER_TYPE"])) {
$value = new ElementPropertyUserField($propertyValues, $property);
} else {
$value = $propertyValues;
}
}
$this->fieldMap[$fieldCode] = $property["ID"];
$this->fieldMap[$property["ID"]] = $property["ID"];
if ($property["CODE"] != "") {
$this->fieldMap[strtolower($property["CODE"])] = $property["ID"];
}
$this->fields[$property["ID"]] = $value;
}
}
}
}
示例7: GetRecommendetProduct
/**
* Returns list of recommended products for specific product.
*
* @param int $USER_ID User id.
* @param string $LID Site id.
* @param array $arFilterRecomendet Recomendation filter.
* @param string $recomMore Get more.
* @param int $cntProductDefault Max count.
* @return array
*/
function GetRecommendetProduct($USER_ID, $LID, $arFilterRecomendet = array(), $recomMore = 'N', $cntProductDefault = 2)
{
$arRecomendetResult = array();
if (CModule::IncludeModule('catalog') && !empty($arFilterRecomendet)) {
$arRecomendet = array();
if (!is_array($arFilterRecomendet)) {
$arFilterRecomendet = array($arFilterRecomendet);
}
Main\Type\Collection::normalizeArrayValuesByInt($arFilterRecomendet);
if (empty($arFilterRecomendet)) {
return $arRecomendetResult;
}
$iblockRecommended = array();
$productIterator = Iblock\ElementTable::getList(array('select' => array('ID', 'IBLOCK_ID'), 'filter' => array('@ID' => $arFilterRecomendet, '=ACTIVE' => 'Y')));
while ($product = $productIterator->fetch()) {
$product['ID'] = (int) $product['ID'];
$product['IBLOCK_ID'] = (int) $product['IBLOCK_ID'];
if (!isset($iblockRecommended[$product['IBLOCK_ID']])) {
$iblockRecommended[$product['IBLOCK_ID']] = array();
}
$iblockRecommended[$product['IBLOCK_ID']][] = $product['ID'];
}
unset($product, $productIterator);
if (empty($iblockRecommended)) {
return $arRecomendetResult;
}
$propertyList = array();
$propertyIterator = Iblock\PropertyTable::getList(array('select' => array('ID', 'IBLOCK_ID'), 'filter' => array('@IBLOCK_ID' => array_keys($iblockRecommended), '=CODE' => 'RECOMMEND', '=PROPERTY_TYPE' => Iblock\PropertyTable::TYPE_ELEMENT)));
while ($property = $propertyIterator->fetch()) {
$property['ID'] = (int) $property['ID'];
$property['IBLOCK_ID'] = (int) $property['IBLOCK_ID'];
$propertyList[$property['IBLOCK_ID']] = $property['ID'];
}
unset($property, $propertyIterator);
if (empty($propertyList)) {
return $arRecomendetResult;
}
foreach ($propertyList as $iblockID => $propertyID) {
$propertyValue = 'PROPERTY_' . $propertyID;
$filter = array('ID' => $iblockRecommended[$iblockID], 'IBLOCK_ID' => $iblockID);
$select = array('ID', 'IBLOCK_ID', $propertyValue);
$propertyValue .= '_VALUE';
$elementIterator = CIBlockElement::GetList(array(), $filter, false, false, $select);
while ($element = $elementIterator->Fetch()) {
if (empty($element[$propertyValue])) {
continue;
}
if (is_array($element[$propertyValue])) {
foreach ($element[$propertyValue] as &$recId) {
$recId = (int) $recId;
if ($recId > 0) {
$arRecomendet[$recId] = true;
}
}
unset($recId);
} else {
$recId = (int) $element[$propertyValue];
if ($recId > 0) {
$arRecomendet[$recId] = true;
}
}
}
}
unset($element, $elementIterator, $select, $filter, $propertyValue, $propertyID, $iblockID, $propertyList);
if (!empty($arRecomendet)) {
$arRecomendet = array_keys($arRecomendet);
$arBuyerGroups = CUser::GetUserGroup($USER_ID);
$arFilter = array("ID" => $arRecomendet, "ACTIVE" => "Y");
$rsElement = CIBlockElement::GetList(array(), $arFilter, false, false, array("NAME", "ID", "LID", 'IBLOCK_ID', 'IBLOCK_SECTION_ID', "DETAIL_PICTURE", "PREVIEW_PICTURE", "DETAIL_PAGE_URL"));
$currentVatMode = CCatalogProduct::getPriceVatIncludeMode();
$currentUseDiscount = CCatalogProduct::getUseDiscount();
CCatalogProduct::setUseDiscount(true);
CCatalogProduct::setPriceVatIncludeMode(true);
CCatalogProduct::setUsedCurrency(CSaleLang::GetLangCurrency($LID));
$i = 0;
while ($arElement = $rsElement->GetNext()) {
if (in_array($arElement["ID"], $arFilterRecomendet)) {
continue;
}
if ($recomMore == "N" && $i < $cntProductDefault || $recomMore == "Y") {
$arElement["MODULE"] = "catalog";
$arElement["PRODUCT_PROVIDER_CLASS"] = "CCatalogProductProvider";
$arElement["PRODUCT_ID"] = $arElement["ID"];
$arPrice = CCatalogProduct::GetOptimalPrice($arElement["ID"], 1, $arBuyerGroups, "N", array(), $LID, array());
$currentPrice = $arPrice['RESULT_PRICE']['DISCOUNT_PRICE'];
$arElement["PRICE"] = $currentPrice;
$arElement["CURRENCY"] = $arPrice["RESULT_PRICE"]["CURRENCY"];
$arElement["DISCOUNT_PRICE"] = $arPrice['RESULT_PRICE']['DISCOUNT'];
if ($arElement["IBLOCK_ID"] > 0 && $arElement["IBLOCK_SECTION_ID"] > 0) {
$arElement["EDIT_PAGE_URL"] = CIBlock::GetAdminElementEditLink($arElement["IBLOCK_ID"], $arElement["PRODUCT_ID"], array("find_section_section" => $arElement["IBLOCK_SECTION_ID"], 'WF' => 'Y'));
//.........这里部分代码省略.........
示例8: setIBlock
function setIBlock($IBLOCK_ID, $propertyID = array())
{
$this->VERSION = CIBlockElement::GetIBVersion($IBLOCK_ID);
if (!empty($propertyID)) {
Collection::normalizeArrayValuesByInt($propertyID);
}
$this->arProperties = array();
if (!empty($propertyID) || empty($propertyID) && !isset(self::$propertiesCache[$IBLOCK_ID])) {
$propertyIterator = PropertyTable::getList(array('select' => array('ID', 'IBLOCK_ID', 'NAME', 'ACTIVE', 'SORT', 'CODE', 'DEFAULT_VALUE', 'PROPERTY_TYPE', 'MULTIPLE', 'LINK_IBLOCK_ID', 'VERSION', 'USER_TYPE', 'USER_TYPE_SETTINGS'), 'filter' => empty($propertyID) ? array('IBLOCK_ID' => $IBLOCK_ID) : array('ID' => $propertyID, 'IBLOCK_ID' => $IBLOCK_ID), 'order' => array('ID' => 'ASC')));
while ($property = $propertyIterator->fetch()) {
if ($property['USER_TYPE']) {
$userType = CIBlockProperty::GetUserType($property['USER_TYPE']);
if (isset($userType["ConvertFromDB"])) {
if (array_key_exists("DEFAULT_VALUE", $property)) {
$value = array("VALUE" => $property["DEFAULT_VALUE"], "DESCRIPTION" => "");
$value = call_user_func_array($userType["ConvertFromDB"], array($property, $value));
$property["DEFAULT_VALUE"] = $value["VALUE"];
}
}
}
if ($property['USER_TYPE_SETTINGS'] !== '' || $property['USER_TYPE_SETTINGS'] !== null) {
$property['USER_TYPE_SETTINGS'] = unserialize($property['USER_TYPE_SETTINGS']);
}
$this->arProperties[$property['ID']] = $property;
}
unset($property, $propertyIterator);
if (empty($propertyID)) {
self::$propertiesCache[$IBLOCK_ID] = $this->arProperties;
}
} else {
$this->arProperties = self::$propertiesCache[$IBLOCK_ID];
}
}
示例9: array
}
if ($ID > 0) {
$canWrite = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::WriteDocument, $USER->GetID(), array(MODULE_ID, ENTITY, $ID), array("AllUserGroups" => $arCurrentUserGroups, "DocumentStates" => $arDocumentStates));
$canRead = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ReadDocument, $USER->GetID(), array(MODULE_ID, ENTITY, $ID), array("AllUserGroups" => $arCurrentUserGroups, "DocumentStates" => $arDocumentStates));
} else {
$canWrite = CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::WriteDocument, $USER->GetID(), array(MODULE_ID, ENTITY, DOCUMENT_TYPE), array("AllUserGroups" => $arCurrentUserGroups, "DocumentStates" => $arDocumentStates));
$canRead = false;
}
if (!$canWrite && !$canRead) {
$error = new _CIBlockError(1, "ACCESS_DENIED", GetMessage("IBLOCK_ACCESS_DENIED_STATUS"));
break;
}
}
//Find out files properties
$arFileProps = array();
$propertyIterator = Iblock\PropertyTable::getList(array('select' => array('ID'), 'filter' => array('=IBLOCK_ID' => $IBLOCK_ID, '=PROPERTY_TYPE' => Iblock\PropertyTable::TYPE_FILE, '=ACTIVE' => 'Y')));
while ($property = $propertyIterator->fetch()) {
$arFileProps[] = $property['ID'];
}
unset($property, $propertyIterator);
//Assembly properties values from $_POST and $_FILES
$PROP = array();
if (isset($_POST['PROP'])) {
$PROP = $_POST['PROP'];
}
//Recover some user defined properties
if (is_array($PROP)) {
foreach ($PROP as $k1 => $val1) {
if (is_array($val1)) {
foreach ($val1 as $k2 => $val2) {
$text_name = preg_replace("/([^a-z0-9])/is", "_", "PROP[" . $k1 . "][" . $k2 . "][VALUE][TEXT]");
示例10: getVisibleColumns
protected function getVisibleColumns()
{
if (self::$iblockIncluded === null) {
self::$iblockIncluded = Main\Loader::includeModule('iblock');
}
if (!self::$iblockIncluded) {
return array();
}
$result = array();
$arTmpColumns = array();
$arColumnsOptions = static::loadVisibleColumns($this->idPrefix);
if (is_array($arColumnsOptions) && isset($arColumnsOptions["columns"]) && strlen($arColumnsOptions["columns"]) > 0) {
$arTmpColumns = explode(",", $arColumnsOptions["columns"]);
}
if (is_array($arTmpColumns) && !empty($arTmpColumns)) {
$arTmpColumns = explode(",", $arColumnsOptions["columns"]);
$iBlockProps = array();
foreach ($arTmpColumns as $id => $columnCode) {
if (substr($columnCode, 0, 9) == "PROPERTY_") {
$iBlockProps[] = substr($columnCode, 9);
} else {
$result[$columnCode] = Loc::getMessage("SALE_ORDER_BASKET_SETTINGS_COL_" . $columnCode);
}
}
$dbRes = \Bitrix\Iblock\PropertyTable::getList(array('filter' => array('=CODE' => $iBlockProps), 'select' => array('ID', 'NAME', 'CODE')));
while ($arPropData = $dbRes->fetch()) {
$result["PROPERTY_" . $arPropData['CODE']] = $arPropData["NAME"];
}
} else {
$result = static::getDefaultVisibleColumns();
}
return $result;
}
示例11: unset
if ($propertyCode == '') {
$propertyCode = $property['ID'];
}
$propertyName = '[' . $propertyCode . '] ' . $property['NAME'];
$arProperty[$propertyCode] = $propertyName;
if ($property['PROPERTY_TYPE'] == Iblock\PropertyTable::TYPE_NUMBER) {
$arProperty_N[$propertyCode] = $propertyName;
}
}
unset($propertyCode, $propertyName, $property, $propertyIterator);
}
$arOffers = CIBlockPriceTools::GetOffersIBlock($arCurrentValues["IBLOCK_ID"]);
$OFFERS_IBLOCK_ID = is_array($arOffers) ? $arOffers["OFFERS_IBLOCK_ID"] : 0;
$arProperty_Offers = array();
if ($OFFERS_IBLOCK_ID) {
$propertyIterator = Iblock\PropertyTable::getList(array('select' => array('ID', 'IBLOCK_ID', 'NAME', 'CODE', 'PROPERTY_TYPE'), 'filter' => array('=IBLOCK_ID' => $OFFERS_IBLOCK_ID, '=ACTIVE' => 'Y', '!=PROPERTY_TYPE' => Iblock\PropertyTable::TYPE_FILE), 'order' => array('SORT' => 'ASC', 'NAME' => 'ASC')));
while ($property = $propertyIterator->fetch()) {
$propertyCode = (string) $property['CODE'];
if ($propertyCode == '') {
$propertyCode = $property['ID'];
}
$propertyName = '[' . $propertyCode . '] ' . $property['NAME'];
$arProperty_Offers[$propertyCode] = $propertyName;
}
unset($propertyCode, $propertyName, $property, $propertyIterator);
}
$arSort = CIBlockParameters::GetElementSortFields(array('SHOWS', 'SORT', 'TIMESTAMP_X', 'NAME', 'ID', 'ACTIVE_FROM', 'ACTIVE_TO'), array('KEY_LOWERCASE' => 'Y'));
$arPrice = array();
if ($boolCatalog) {
$arSort = array_merge($arSort, CCatalogIBlockParameters::GetCatalogSortFields());
$arPrice = CCatalogIBlockParameters::getPriceTypesList();
示例12: getClearedPropertiesID
public static function getClearedPropertiesID($iblockID, $propertyCodes = array())
{
$iblockID = (int) $iblockID;
if ($iblockID <= 0) {
return array();
}
if (empty($propertyCodes) || !is_array($propertyCodes)) {
$propertyCodes = array(self::CODE_BLOG_POST, self::CODE_BLOG_COMMENTS_COUNT, self::CODE_FORUM_TOPIC, self::CODE_FORUM_MESSAGES_COUNT, self::CODE_VOTE_COUNT, self::CODE_VOTE_COUNT_OLD, self::CODE_VOTE_SUMM, self::CODE_VOTE_SUMM_OLD, self::CODE_VOTE_RATING, self::CODE_VOTE_RATING_OLD);
}
$result = array();
$propertyIterator = PropertyTable::getList(array('select' => array('ID'), 'filter' => array('IBLOCK_ID' => $iblockID, '=CODE' => $propertyCodes)));
while ($property = $propertyIterator->fetch()) {
$result[] = (int) $property['ID'];
}
return $result;
}
示例13: getOffersList
public static function getOffersList($productID, $iblockID = 0, $skuFilter = array(), $fields = array(), $propertyFilter = array())
{
$iblockID = (int)$iblockID;
if (!is_array($productID))
$productID = array($productID);
Collection::normalizeArrayValuesByInt($productID);
if (empty($productID))
return false;
if (!is_array($skuFilter))
$skuFilter = array();
if (!is_array($fields))
$fields = array($fields);
$fields = array_merge($fields, array('ID', 'IBLOCK_ID'));
if (!is_array($propertyFilter))
$propertyFilter = array();
$iblockProduct = array();
$iblockSku = array();
$offersIblock = array();
if ($iblockID == 0)
{
$iblockList = array();
$elementIterator = Iblock\ElementTable::getList(array(
'select' => array('ID', 'IBLOCK_ID'),
'filter' => array('=ID' => $productID)
));
while ($element = $elementIterator->fetch())
{
$element['ID'] = (int)$element['ID'];
$element['IBLOCK_ID'] = (int)$element['IBLOCK_ID'];
if (!isset($iblockList[$element['IBLOCK_ID']]))
$iblockList[$element['IBLOCK_ID']] = array();
$iblockList[$element['IBLOCK_ID']][] = $element['ID'];
}
unset($element, $elementIterator);
if (!empty($iblockList))
{
$iblockIterator = Catalog\CatalogIblockTable::getList(array(
'select' => array('IBLOCK_ID', 'PRODUCT_IBLOCK_ID', 'SKU_PROPERTY_ID', 'VERSION' => 'IBLOCK.VERSION'),
'filter' => array('=PRODUCT_IBLOCK_ID' => array_keys($iblockList))
));
while ($iblock = $iblockIterator->fetch())
{
$iblock['IBLOCK_ID'] = (int)$iblock['IBLOCK_ID'];
$iblock['PRODUCT_IBLOCK_ID'] = (int)$iblock['PRODUCT_IBLOCK_ID'];
$iblock['SKU_PROPERTY_ID'] = (int)$iblock['SKU_PROPERTY_ID'];
$iblock['VERSION'] = (int)$iblock['VERSION'];
$iblockSku[$iblock['PRODUCT_IBLOCK_ID']] = $iblock;
self::$arProductCache[$iblock['PRODUCT_IBLOCK_ID']] = $iblock;
self::$arOfferCache[$iblock['IBLOCK_ID']] = $iblock;
$offersIblock[] = $iblock['IBLOCK_ID'];
$iblockProduct[$iblock['PRODUCT_IBLOCK_ID']] = $iblockList[$iblock['PRODUCT_IBLOCK_ID']];
}
unset($iblock, $iblockIterator);
}
unset($iblockList);
}
else
{
$iblockIterator = Catalog\CatalogIblockTable::getList(array(
'select' => array('IBLOCK_ID', 'PRODUCT_IBLOCK_ID', 'SKU_PROPERTY_ID', 'VERSION' => 'IBLOCK.VERSION'),
'filter' => array('=PRODUCT_IBLOCK_ID' => $iblockID)
));
if ($iblock = $iblockIterator->fetch())
{
$iblock['IBLOCK_ID'] = (int)$iblock['IBLOCK_ID'];
$iblock['PRODUCT_IBLOCK_ID'] = (int)$iblock['PRODUCT_IBLOCK_ID'];
$iblock['SKU_PROPERTY_ID'] = (int)$iblock['SKU_PROPERTY_ID'];
$iblock['VERSION'] = (int)$iblock['VERSION'];
$iblockSku[$iblock['PRODUCT_IBLOCK_ID']] = $iblock;
self::$arProductCache[$iblock['PRODUCT_IBLOCK_ID']] = $iblock;
self::$arOfferCache[$iblock['IBLOCK_ID']] = $iblock;
$offersIblock[] = $iblock['IBLOCK_ID'];
$iblockProduct[$iblockID] = $productID;
}
unset($iblock, $iblockIterator);
}
if (empty($iblockProduct))
return array();
$propertyFilter = array_filter($propertyFilter);
if (isset($propertyFilter['ID']))
{
$propertyFilter['ID'] = array_filter($propertyFilter['ID']);
if (empty($propertyFilter['ID']))
unset($propertyFilter['ID']);
}
if (isset($propertyFilter['CODE']))
{
$propertyFilter['CODE'] = array_filter($propertyFilter['CODE']);
if (empty($propertyFilter['CODE']))
unset($propertyFilter['CODE']);
}
$iblockProperties = array();
if (!empty($propertyFilter['ID']) || !empty($propertyFilter['CODE']))
{
$propertyIblock = array('=IBLOCK_ID' => $offersIblock);
if (!empty($propertyFilter['ID']))
$propertyIblock['=ID'] = $propertyFilter['ID'];
//.........这里部分代码省略.........
示例14: array
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$jsParams = array();
$types = array();
$rsTypes = \Bitrix\Iblock\TypeLanguageTable::getList(array('filter' => array('LANGUAGE_ID' => LANG)));
while ($type = $rsTypes->fetch()) {
$types[$type['IBLOCK_TYPE_ID']] = $type['NAME'];
}
$jsParams['types'] = array('name' => 'selectTypes', 'list' => $types);
$iblocks = array();
$rsIblocks = \Bitrix\Iblock\IblockTable::getList();
while ($iblock = $rsIblocks->fetch()) {
$iblocks[$iblock['ID']] = array('name' => $iblock['NAME'], 'type' => $iblock['IBLOCK_TYPE_ID']);
}
$jsParams['iblocks'] = array('name' => 'selectIblocks', 'list' => $iblocks);
$properties = array();
$rsProperties = \Bitrix\Iblock\PropertyTable::getList(array('filter' => array('PROPERTY_TYPE' => \Bitrix\Iblock\PropertyTable::TYPE_STRING, 'USER_TYPE' => NULL)));
while ($property = $rsProperties->fetch()) {
$properties[$property['ID']] = array('name' => $property['NAME'], 'iblockId' => $property['IBLOCK_ID']);
}
$jsParams['properties'] = array('name' => 'selectProperties', 'list' => $properties);
/** @var $localization \WS\Tools\Localization */
$localization;
?>
<form method="POST"
action="<?php
echo $APPLICATION->GetCurUri();
?>
"
ENCTYPE="multipart/form-data"
name="apply">
示例15: elseif
$arFieldsTmp = $productProvider::GetProductData(array("PRODUCT_ID" => $newProductId['ID'], "QUANTITY" => $arItem['QUANTITY'], "RENEWAL" => "N", "USER_ID" => $USER->GetID(), "SITE_ID" => SITE_ID, "BASKET_ID" => $arItem['ID'], "CHECK_QUANTITY" => "Y", "CHECK_PRICE" => "Y", "NOTES" => $arItem["NOTES"]));
} elseif (isset($arItem["CALLBACK_FUNC"]) && !empty($arItem["CALLBACK_FUNC"])) {
$arFieldsTmp = CSaleBasket::ExecuteCallbackFunction($arItem["CALLBACK_FUNC"], $arItem["MODULE"], $newProductId['ID'], $arItem['QUANTITY'], "N", $USER->GetID(), SITE_ID);
}
if (!empty($arFieldsTmp) && is_array($arFieldsTmp)) {
$arFields = array('PRODUCT_ID' => $newProductId['ID'], 'PRODUCT_PRICE_ID' => $arFieldsTmp["PRODUCT_PRICE_ID"], 'PRICE' => $arFieldsTmp["PRICE"], 'CURRENCY' => $arFieldsTmp["CURRENCY"], 'QUANTITY' => $arFieldsTmp['QUANTITY'], 'WEIGHT' => $arFieldsTmp['WEIGHT']);
$arProps = array();
if (strpos($newProductId['XML_ID'], '#') === false) {
$parentIterator = \Bitrix\Iblock\ElementTable::getList(array('select' => array('ID', 'XML_ID'), 'filter' => array('ID' => $parentId)));
if ($parentProduct = $parentIterator->fetch()) {
$newProductId['XML_ID'] = $parentProduct['XML_ID'] . '#' . $newProductId['XML_ID'];
}
unset($parentProduct, $parentIterator);
}
$arFields["PRODUCT_XML_ID"] = $newProductId['XML_ID'];
$propertyIterator = \Bitrix\Iblock\PropertyTable::getList(array('select' => array('ID', 'CODE'), 'filter' => array('IBLOCK_ID' => $newProductId['IBLOCK_ID'], '!ID' => $sku['SKU_PROPERTY_ID'])));
while ($property = $propertyIterator->fetch()) {
$property['CODE'] = (string) $property['CODE'];
$arPropsSku[] = $property['CODE'] != '' ? $property['CODE'] : $property['ID'];
}
unset($property, $propertyIterator);
$product_properties = CIBlockPriceTools::GetOfferProperties($newProductId['ID'], $sku['PRODUCT_IBLOCK_ID'], $arPropsSku);
$newValues = array();
foreach ($product_properties as $productSkuProp) {
$bFieldExists = false;
foreach ($strOffersProps as $existingSkuProp) {
if ($existingSkuProp == $productSkuProp["CODE"]) {
$bFieldExists = true;
break;
}
}