本文整理汇总了PHP中Bitrix\Highloadblock\HighloadBlockTable类的典型用法代码示例。如果您正苦于以下问题:PHP HighloadBlockTable类的具体用法?PHP HighloadBlockTable怎么用?PHP HighloadBlockTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了HighloadBlockTable类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getPropDirectory
function getPropDirectory(&$property)
{
if (empty($property)) {
return false;
}
if (!is_array($property)) {
return false;
}
if (!isset($property['USER_TYPE_SETTINGS']['TABLE_NAME']) || empty($property['USER_TYPE_SETTINGS']['TABLE_NAME'])) {
return false;
}
$highLoadInclude = \Bitrix\Main\Loader::includeModule('highloadblock');
$highBlock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array("filter" => array('TABLE_NAME' => $property['USER_TYPE_SETTINGS']['TABLE_NAME'])))->fetch();
if (!isset($highBlock['ID'])) {
return false;
}
$entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($highBlock);
$entityDataClass = $entity->getDataClass();
$entityList = $entityDataClass::getList();
while ($arEntityItem = $entityList->Fetch()) {
$val =& $property["VALUES"][$arEntityItem["UF_XML_ID"]];
//foreach($property["VALUES"] as &$val){
if (!empty($arEntityItem["UF_FILE"])) {
$property["PICTURE_INCLUDED"] = true;
$arEntityItem["~UF_FILE"] = $arEntityItem["UF_FILE"];
$arEntityItem["PICTURE"] = CFile::GetPath($arEntityItem["~UF_FILE"]);
}
if (!empty($arEntityItem)) {
$val = array_merge($val, $arEntityItem);
}
//}
//echo'<pre>';print_r($arEntityItem);echo'</pre>';
}
return true;
}
开发者ID:sharapudinov,项目名称:lovestore.top,代码行数:35,代码来源:functions.php
示例2:
function __construct($hlblockid)
{
$this->hlBlockID = $hlblockid;
$hlblock = HL\HighloadBlockTable::getById($hlblockid)->fetch();
$entity = HL\HighloadBlockTable::compileEntity($hlblock);
$this->hlHandler = $entity->getDataClass();
}
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:7,代码来源:highloadblocks.php
示例3: UnInstallDB
function UnInstallDB($arParams = array())
{
global $DB, $DBType, $APPLICATION;
$this->errors = false;
if (!array_key_exists("save_tables", $arParams) || $arParams["save_tables"] != "Y") {
// remove user data
CModule::IncludeModule("highloadblock");
$result = \Bitrix\Highloadblock\HighloadBlockTable::getList();
while ($hldata = $result->fetch()) {
\Bitrix\Highloadblock\HighloadBlockTable::delete($hldata['ID']);
}
// remove hl system data
$this->errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/highloadblock/install/db/" . strtolower($DB->type) . "/uninstall.sql");
}
UnRegisterModule("highloadblock");
UnRegisterModuleDependences("main", "OnBeforeUserTypeAdd", "highloadblock", '\\Bitrix\\Highloadblock\\HighloadBlockTable', "OnBeforeUserTypeAdd");
UnRegisterModuleDependences("main", "OnAfterUserTypeAdd", "highloadblock", '\\Bitrix\\Highloadblock\\HighloadBlockTable', "onAfterUserTypeAdd");
UnRegisterModuleDependences("main", "OnBeforeUserTypeDelete", "highloadblock", '\\Bitrix\\Highloadblock\\HighloadBlockTable', "OnBeforeUserTypeDelete");
UnRegisterModuleDependences('main', 'OnUserTypeBuildList', 'highloadblock', 'CUserTypeHlblock', 'GetUserTypeDescription');
UnRegisterModuleDependences('iblock', 'OnIBlockPropertyBuildList', 'highloadblock', 'CIBlockPropertyDirectory', 'GetUserTypeDescription');
if ($this->errors !== false) {
$APPLICATION->ThrowException(implode("<br>", $this->errors));
return false;
}
return true;
}
开发者ID:Satariall,项目名称:izurit,代码行数:26,代码来源:index.php
示例4: __construct
/**
* Constructor.
*
* @param array $params
*
* @throws SkipHandlerException
*/
public function __construct($params)
{
$this->event = $params[0];
$eventParams = $this->event->getParameters();
$this->id = $eventParams['id']['ID'];
$this->fields = HighloadBlockTable::getById($this->id)->fetch();
}
开发者ID:arrilot,项目名称:bitrix-migrations,代码行数:14,代码来源:OnBeforeHLBlockDelete.php
示例5: deleteHlblock
public function deleteHlblock($hlblockId)
{
$result = HL\HighloadBlockTable::delete($hlblockId);
if ($result->isSuccess()) {
return true;
}
$this->throwException(__METHOD__, implode(', ', $result->getErrors()));
}
开发者ID:andreyryabin,项目名称:sprint.migration,代码行数:8,代码来源:HlblockHelper.php
示例6: connectToBlock
function connectToBlock($blockId)
{
$hlblock_requests = HL\HighloadBlockTable::getById($blockId)->fetch();
//requests
$entity_requests = HL\HighloadBlockTable::compileEntity($hlblock_requests);
$entity_requests_data_class = $entity_requests->getDataClass();
return $entity_requests_data_class;
}
开发者ID:spas-viktor,项目名称:books,代码行数:8,代码来源:block_funcs.php
示例7: getUserType
/**
* Check last user type in logs
* @param $userID
*
* @return string
*/
function getUserType($userID)
{
global $USER;
$hbKPI = HL\HighloadBlockTable::getById(HLBLOCK_KPIAMPLIFIER)->fetch();
$entityKPI = HL\HighloadBlockTable::compileEntity($hbKPI);
$entity_data_class = $entityKPI->getDataClass();
$arUserType2R = array("38" => "1", "39" => "2", "40" => "3", "41" => "4", "42" => "5", "44" => "5");
$rsDataHLAll = $entity_data_class::getList(array("select" => array("*"), "order" => array("ID" => "DESC"), "filter" => array("UF_AMPLIFIER" => $USER->GetID(), "UF_USER" => IntVal($userID))));
if ($ar_fieldsGoodAll = $rsDataHLAll->Fetch()) {
return $arUserType2R[$ar_fieldsGoodAll['UF_TYPE_2']];
} else {
return '2';
}
}
开发者ID:dayAlone,项目名称:MyQube,代码行数:20,代码来源:app.php
示例8: create
/**
* @inheritdoc
*/
public function create(ParameterDictionary $parameters)
{
$highLoadBlockId = (int) $parameters->get('ID');
$highLoadBlock = HL\HighloadBlockTable::getById($highLoadBlockId)->fetch();
if (empty($highLoadBlock)) {
throw new BuilderException(sprintf('Not found highloadblock with id = %d', $highLoadBlockId));
}
$highLoadBlockFields = $this->getUserFieldManager()->GetUserFields(sprintf('HLBLOCK_%d', $highLoadBlockId), 0, LANGUAGE_ID);
$this->setHighLoadBlockFields($highLoadBlockFields);
$this->setElementValue();
$this->setSectionValue();
$this->setEnumValue();
return array('DATA' => $highLoadBlock, 'FIELDS' => $this->getHighLoadBlockFields());
}
开发者ID:ASDAFF,项目名称:citfact.form,代码行数:17,代码来源:UserFieldBuilder.php
示例9: getEntity
/**
* @param $hblockId
* @return \Bitrix\Main\Entity\Base
* @throws \Exception
*/
protected static function getEntity($hblockId)
{
$hblockId = intval($hblockId);
if (self::$hblockEntities[$hblockId]) {
return self::$hblockEntities[$hblockId];
}
$hlData = HighloadBlockTable::getById($hblockId)->fetch();
if (!$hlData) {
throw new \Exception("Hblock {$hblockId} not found");
}
// описание полей hl блока
$obUserField = new \CUserTypeManager();
self::$hblockEntityFields[$hblockId] = $obUserField->GetUserFields('HLBLOCK_' . $hlData['ID'], 0, LANGUAGE_ID);
return self::$hblockEntities[$hblockId] = HighloadBlockTable::compileEntity($hlData);
}
开发者ID:ASDAFF,项目名称:Bitrix,代码行数:20,代码来源:HblockObject.php
示例10: down
public function down()
{
global $APPLICATION;
$arHlData = $this->arHlData;
\Bitrix\Main\Loader::includeModule("highloadblock");
$arHlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array('filter' => array('TABLE_NAME' => \Hawkart\Megatv\PeopleTable::getTableName())))->fetch();
if ($arHlblock) {
foreach ($arHlData as $fieldName => $fieldValue) {
$oUserTypeEntity = new \CUserTypeEntity();
$resProperty = \CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'HLBLOCK_' . $arHlblock["ID"], 'FIELD_NAME' => $fieldName));
if ($aUserHasField = $resProperty->Fetch()) {
$oUserTypeEntity->Delete($aUserHasField['ID']);
$this->outSuccess("Свойство удалено!");
}
}
}
}
开发者ID:Hawkart,项目名称:megatv,代码行数:17,代码来源:Version20160829145834.php
示例11: down
public function down()
{
global $APPLICATION;
\Bitrix\Main\Loader::includeModule("highloadblock");
$arHlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array('filter' => array('TABLE_NAME' => \Hawkart\Megatv\SubscribeTable::getTableName())))->fetch();
if ($arHlblock) {
$arProps = array("UF_DATETIME_TO");
foreach ($arProps as $prop_name) {
$oUserTypeEntity = new \CUserTypeEntity();
$resProperty = \CUserTypeEntity::GetList(array(), array('ENTITY_ID' => 'HLBLOCK_' . $arHlblock["ID"], 'FIELD_NAME' => $prop_name));
if ($aUserHasField = $resProperty->Fetch()) {
$oUserTypeEntity->Delete($aUserHasField['ID']);
$this->outSuccess("Свойство 'Дата окончания подписки' удалено!");
}
}
}
}
开发者ID:Hawkart,项目名称:megatv,代码行数:17,代码来源:Version20160720205816.php
示例12: changeUserStatus
function changeUserStatus($ID, $PARENT, $CURRENT, $NEW, $text)
{
CModule::IncludeModule("iblock");
CModule::IncludeModule("highloadblock");
global $APPLICATION;
$fields = getValuesList('UF_STATUS', 'USER', 'ID');
$flipFields = array_flip($fields);
$types = array(getValuesList('UF_TYPE', 'HLBLOCK_2', 'ID'), getValuesList('UF_TYPE_2', 'HLBLOCK_2', 'ID'));
$raw = new CUser();
$raw->Update($ID, array('UF_INVITE_STATUS' => 1, 'UF_STATUS' => $fields[$NEW]));
$hbKPI = HL\HighloadBlockTable::getById(2)->fetch();
$entityKPI = HL\HighloadBlockTable::compileEntity($hbKPI);
$logKPI = $entityKPI->getDataClass();
$logKPI::add(array('UF_USER' => intval($ID), 'UF_AMPLIFIER' => intval($PARENT), 'UF_EVENT' => 0, 'UF_DATE_TIME' => date("Y-m-d H:i:s"), 'UF_ACTION_CODE' => 103, 'UF_ACTION_TEXT' => "change_status", 'UF_TYPE' => $CURRENT ? $types[0][$flipFields[$CURRENT]] : 1, 'UF_TYPE_2' => $types[1][$NEW]));
$hbLOG = HL\HighloadBlockTable::getById(4)->fetch();
$entityLOG = HL\HighloadBlockTable::compileEntity($hbLOG);
$logLOG = $entityLOG->getDataClass();
$res = $logLOG::add(array('UF_USER' => intval($ID), 'UF_AMPLIFIER' => intval($PARENT), 'UF_EVENT' => 0, 'UF_DATE_TIME' => date("d.m.Y H:i:s", time()), "UF_ACTION_CODE" => 104, "UF_ACTION_TEXT" => $text, "UF_TYPE" => $CURRENT ? $flipFields[$CURRENT] : 1, "UF_TYPE_2" => $NEW));
}
开发者ID:dayAlone,项目名称:MyQube,代码行数:19,代码来源:helpers.php
示例13: getEntityByName
/**
* Ищет данные о сущности по ее названию
* @param string $name
* @return array
*/
public static function getEntityByName($name)
{
if (empty(self::$_entities[$name]) || !array_key_exists($name, self::$_entities[$name])) {
$cid = 'bxar\\helpers\\HlEntity_' . $name;
$obCache = new \CPHPCache();
if ($obCache->InitCache(7200, $cid, '/')) {
self::$_entities[$name] = $obCache->GetVars();
} elseif ($obCache->StartDataCache()) {
$filter = ['select' => ['ID', 'NAME', 'TABLE_NAME'], 'filter' => ['NAME' => $name]];
$hlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList($filter)->fetch();
if (!empty($hlblock['ID'])) {
self::$_entities[$name] = $hlblock;
} else {
self::$_entities[$name] = null;
}
$obCache->EndDataCache(self::$_entities[$name]);
}
}
return self::$_entities[$name];
}
开发者ID:marvin255,项目名称:bxar,代码行数:25,代码来源:HlEntity.php
示例14: getFiles
/**
* {@inheritdoc}
*/
public function getFiles($insertId, array $attachFields)
{
$filesList = array();
$builderData = $this->builder->getBuilderData();
$enity = HL\HighloadBlockTable::compileEntity($builderData['DATA']);
$enity = $enity->getDataClass();
$resultDb = $enity::getList(array('filter' => array('ID' => $insertId)));
if (!($fields = $resultDb->fetch())) {
return $filesList;
}
foreach ($fields as $key => $value) {
if (!in_array($key, $attachFields)) {
continue;
}
if (is_numeric($value)) {
$filesList[] = $value;
} elseif (is_array($value)) {
$filesList = array_merge_recursive($filesList, $value);
}
}
return $filesList;
}
开发者ID:ASDAFF,项目名称:citfact.form,代码行数:25,代码来源:UserFieldAttach.php
示例15: GetCityList
public static function GetCityList() {
$arResult = array();
$rsData = \Bitrix\Highloadblock\HighloadBlockTable::getList(array('filter'=>array('NAME'=>CITY_LIST_HLB)));
if ( !($arData = $rsData->fetch()) ){
echo 'Инфоблок не найден';
} else {
$Entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($arData);
$Query = new \Bitrix\Main\Entity\Query($Entity);
$Query->setSelect(array('*'));
$result = $Query->exec();
$result = new CDBResult($result);
while ($row = $result->Fetch()){
$arResult[$row['UF_CITY_CODE']] = $row['UF_CITY_NAME'];
}
}
return $arResult;
}
开发者ID:AlexPrya,项目名称:iShop,代码行数:24,代码来源:CISCity.php
示例16: getSkuPropsData
public function getSkuPropsData($arBasketItems, $arParents, $arSkuProps = array())
{
$arRes = array();
$arSkuIblockID = array();
if (is_array($arParents)) {
foreach ($arBasketItems as &$arItem) {
if (array_key_exists($arItem["PRODUCT_ID"], $arParents)) {
$arSKU = CCatalogSKU::GetInfoByProductIBlock($arParents[$arItem["PRODUCT_ID"]]["IBLOCK_ID"]);
if (!array_key_exists($arSKU["IBLOCK_ID"], $arSkuIblockID)) {
$arSkuIblockID[$arSKU["IBLOCK_ID"]] = $arSKU;
}
$arItem["IBLOCK_ID"] = $arSKU["IBLOCK_ID"];
$arItem["SKU_PROPERTY_ID"] = $arSKU["SKU_PROPERTY_ID"];
}
}
unset($arItem);
foreach ($arSkuIblockID as $skuIblockID => $arSKU) {
// possible props values
$rsProps = CIBlockProperty::GetList(array('SORT' => 'ASC', 'ID' => 'ASC'), array('IBLOCK_ID' => $skuIblockID, 'ACTIVE' => 'Y'));
while ($arProp = $rsProps->Fetch()) {
if ($arProp['PROPERTY_TYPE'] == 'L' || $arProp['PROPERTY_TYPE'] == 'E' || $arProp['PROPERTY_TYPE'] == 'S' && $arProp['USER_TYPE'] == 'directory') {
if ($arProp['XML_ID'] == 'CML2_LINK') {
continue;
}
if (!in_array($arProp['CODE'], $arSkuProps)) {
continue;
}
$arValues = array();
if ($arProp['PROPERTY_TYPE'] == 'L') {
$arValues = array();
$rsPropEnums = CIBlockProperty::GetPropertyEnum($arProp['ID']);
while ($arEnum = $rsPropEnums->Fetch()) {
$arValues['n' . $arEnum['ID']] = array('ID' => $arEnum['ID'], 'NAME' => $arEnum['VALUE'], 'PICT' => false);
}
} elseif ($arProp['PROPERTY_TYPE'] == 'E') {
$rsPropEnums = CIBlockElement::GetList(array('SORT' => 'ASC'), array('IBLOCK_ID' => $arProp['LINK_IBLOCK_ID'], 'ACTIVE' => 'Y'), false, false, array('ID', 'NAME', 'PREVIEW_PICTURE'));
while ($arEnum = $rsPropEnums->Fetch()) {
$arEnum['PREVIEW_PICTURE'] = CFile::GetFileArray($arEnum['PREVIEW_PICTURE']);
if (!is_array($arEnum['PREVIEW_PICTURE'])) {
$arEnum['PREVIEW_PICTURE'] = false;
}
if ($arEnum['PREVIEW_PICTURE'] !== false) {
$productImg = CFile::ResizeImageGet($arEnum['PREVIEW_PICTURE'], array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
$arEnum['PREVIEW_PICTURE']['SRC'] = $productImg['src'];
}
$arValues['n' . $arEnum['ID']] = array('ID' => $arEnum['ID'], 'NAME' => $arEnum['NAME'], 'SORT' => $arEnum['SORT'], 'PICT' => $arEnum['PREVIEW_PICTURE']);
}
} elseif ($arProp['PROPERTY_TYPE'] == 'S' && $arProp['USER_TYPE'] == 'directory') {
if (self::$highLoadInclude === null) {
self::$highLoadInclude = Loader::includeModule('highloadblock');
}
if (self::$highLoadInclude) {
$hlblock = HL\HighloadBlockTable::getList(array("filter" => array("=TABLE_NAME" => $arProp["USER_TYPE_SETTINGS"]["TABLE_NAME"])))->fetch();
if ($hlblock) {
$entity = HL\HighloadBlockTable::compileEntity($hlblock);
$entity_data_class = $entity->getDataClass();
$rsData = $entity_data_class::getList();
while ($arData = $rsData->fetch()) {
$arValues['n' . $arData['ID']] = array('ID' => $arData['ID'], 'NAME' => $arData['UF_NAME'], 'SORT' => $arData['UF_SORT'], 'FILE' => $arData['UF_FILE'], 'PICT' => false, 'XML_ID' => $arData['UF_XML_ID']);
}
}
}
}
if (!empty($arValues) && is_array($arValues)) {
$arRes[$skuIblockID][$arProp['ID']] = array('ID' => $arProp['ID'], 'CODE' => $arProp['CODE'], 'NAME' => $arProp['NAME'], 'TYPE' => $arProp['PROPERTY_TYPE'], 'USER_TYPE' => $arProp['USER_TYPE'], 'VALUES' => $arValues);
}
}
}
}
foreach ($arBasketItems as &$arItem) {
if (isset($arItem["IBLOCK_ID"]) && (int) $arItem["IBLOCK_ID"] > 0 && isset($arRes[$arItem["IBLOCK_ID"]])) {
$arItem["SKU_DATA"] = $arRes[$arItem["IBLOCK_ID"]];
$arUsedValues = array();
$arTmpRes = array();
$arOfFilter = array("IBLOCK_ID" => $arItem["IBLOCK_ID"], "PROPERTY_" . $arSkuIblockID[$arItem["IBLOCK_ID"]]["SKU_PROPERTY_ID"] => $arParents[$arItem["PRODUCT_ID"]]["PRODUCT_ID"]);
$rsOffers = CIBlockElement::GetList(array(), $arOfFilter, false, false, array("ID", "IBLOCK_ID"));
while ($obOffer = $rsOffers->GetNextElement()) {
$arProps = $obOffer->GetProperties();
foreach ($arProps as $propName => $propValue) {
if (in_array($propName, $arSkuProps)) {
if (array_key_exists('VALUE', $propValue)) {
if (strlen($propValue['VALUE']) > 0 && (!is_array($arUsedValues[$arItem["PRODUCT_ID"]][$propName]) || !in_array($propValue['VALUE'], $arUsedValues[$arItem["PRODUCT_ID"]][$propName]))) {
$arUsedValues[$arItem["PRODUCT_ID"]][$propName][] = $propValue['VALUE'];
}
}
}
}
}
if (!empty($arUsedValues)) {
// add only used values to the item SKU_DATA
foreach ($arRes[$arItem["IBLOCK_ID"]] as $propId => $arProp) {
if (!array_key_exists($arProp["CODE"], $arUsedValues[$arItem["PRODUCT_ID"]])) {
continue;
}
$arTmpRes['n' . $propId] = array();
foreach ($arProp["VALUES"] as $valId => $arValue) {
// properties of various type have different values in the used values data
if ($arProp["TYPE"] == "L" && in_array($arValue["NAME"], $arUsedValues[$arItem["PRODUCT_ID"]][$arProp["CODE"]]) || $arProp["TYPE"] == "E" && in_array($arValue["ID"], $arUsedValues[$arItem["PRODUCT_ID"]][$arProp["CODE"]]) || $arProp["TYPE"] == "S" && in_array($arValue["XML_ID"], $arUsedValues[$arItem["PRODUCT_ID"]][$arProp["CODE"]])) {
if ($arProp["TYPE"] == "S") {
if (!empty($arValue["FILE"])) {
//.........这里部分代码省略.........
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:101,代码来源:class.php
示例17: array
<?php
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
define('ITUA_WISH_LIST', 4);
global $USER;
use Bitrix\Highloadblock as HL;
use Bitrix\Main\Entity;
use Bitrix\Main\Loader;
use Bitrix\Main\Application;
use Bitrix\Main\SystemException;
Loader::includeModule('highloadblock');
$request = Application::getInstance()->getContext()->getRequest();
$idProduct = (int) $request->getPost('idProduct');
$idUser = (int) $request->getPost('idUser');
if ($idProduct && $idUser) {
$hlblock = HL\HighloadBlockTable::getById(ITUA_WISH_LIST)->fetch();
$entity = HL\HighloadBlockTable::compileEntity($hlblock);
$entity_data_class = $entity->getDataClass();
$rsData = $entity_data_class::getList(array("select" => array("*"), "order" => array("ID" => "ASC"), "filter" => array('UF_USER' => $idUser, 'UF_PRODUCT' => $idProduct)));
while ($arData = $rsData->Fetch()) {
$entity_data_class::Delete($arData['ID']);
}
} else {
throw new SystemException("Error with parameters - idProduct and idUser");
}
开发者ID:VitaliiSestrenskyi,项目名称:wishlist,代码行数:25,代码来源:ajax_sestrenskyi_wishList_del.php
示例18: obtainBasketPropsSKU
public function obtainBasketPropsSKU(&$arBasketItems, $arSkuProps, $arParents)
{
$arRes = array();
$arSkuIblockID = array();
if (self::isNonemptyArray($arBasketItems) && self::isNonemptyArray($arParents)) {
foreach ($arBasketItems as &$arItem) {
// catalog-specific logic farther
if (!$this->cameFromCatalog($arItem)) {
continue;
}
if (array_key_exists($arItem["PRODUCT_ID"], $arParents)) {
$arSKU = CCatalogSKU::GetInfoByProductIBlock($arParents[$arItem["PRODUCT_ID"]]["IBLOCK_ID"]);
if (!array_key_exists($arSKU["IBLOCK_ID"], $arSkuIblockID)) {
$arSkuIblockID[$arSKU["IBLOCK_ID"]] = $arSKU;
}
$arItem["IBLOCK_ID"] = $arSKU["IBLOCK_ID"];
$arItem["SKU_PROPERTY_ID"] = $arSKU["SKU_PROPERTY_ID"];
}
}
unset($arItem);
if ($this->useIBlock) {
if (!self::isNonemptyArray($arSkuProps)) {
$arSkuProps = array();
}
foreach ($arSkuIblockID as $skuIblockID => $arSKU) {
// possible props values
$rsProps = CIBlockProperty::GetList(array('SORT' => 'ASC', 'ID' => 'ASC'), array('IBLOCK_ID' => $skuIblockID, 'ACTIVE' => 'Y'));
while ($arProp = $rsProps->Fetch()) {
if ($arProp['PROPERTY_TYPE'] == 'L' || $arProp['PROPERTY_TYPE'] == 'E' || $arProp['PROPERTY_TYPE'] == 'S' && $arProp['USER_TYPE'] == 'directory') {
if ($arProp['XML_ID'] == 'CML2_LINK') {
continue;
}
if (!in_array($arProp['CODE'], $arSkuProps)) {
continue;
}
$arRes[$skuIblockID][$arProp['ID']] = array('ID' => $arProp['ID'], 'CODE' => $arProp['CODE'], 'NAME' => $arProp['NAME'], 'TYPE' => $arProp['PROPERTY_TYPE'], 'VALUES' => array());
if ($arProp['PROPERTY_TYPE'] == 'L') {
$arValues = array();
$rsPropEnums = CIBlockProperty::GetPropertyEnum($arProp['ID']);
while ($arEnum = $rsPropEnums->Fetch()) {
$arValues[$arEnum['ID']] = array('ID' => $arEnum['ID'], 'NAME' => $arEnum['VALUE'], 'PICT' => false);
}
$arRes[$skuIblockID][$arProp['ID']]['VALUES'] = $arValues;
} elseif ($arProp['PROPERTY_TYPE'] == 'E') {
$arValues = array();
$rsPropEnums = CIBlockElement::GetList(array('SORT' => 'ASC'), array('IBLOCK_ID' => $arProp['LINK_IBLOCK_ID'], 'ACTIVE' => 'Y'), false, false, array('ID', 'NAME', 'PREVIEW_PICTURE'));
while ($arEnum = $rsPropEnums->Fetch()) {
$arEnum['PREVIEW_PICTURE'] = CFile::GetFileArray($arEnum['PREVIEW_PICTURE']);
if (!is_array($arEnum['PREVIEW_PICTURE'])) {
continue;
}
$productImg = CFile::ResizeImageGet($arEnum['PREVIEW_PICTURE'], array('width' => 80, 'height' => 80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
$arEnum['PREVIEW_PICTURE']['SRC'] = $productImg['src'];
$arValues[$arEnum['ID']] = array('ID' => $arEnum['ID'], 'NAME' => $arEnum['NAME'], 'SORT' => $arEnum['SORT'], 'PICT' => $arEnum['PREVIEW_PICTURE']);
}
$arRes[$skuIblockID][$arProp['ID']]['VALUES'] = $arValues;
} elseif ($arProp['PROPERTY_TYPE'] == 'S' && $arProp['USER_TYPE'] == 'directory') {
$arValues = array();
if ($this->useHL) {
$hlblock = HL\HighloadBlockTable::getList(array("filter" => array("TABLE_NAME" => $arProp["USER_TYPE_SETTINGS"]["TABLE_NAME"])))->fetch();
if ($hlblock) {
$entity = HL\HighloadBlockTable::compileEntity($hlblock);
$entity_data_class = $entity->getDataClass();
$rsData = $entity_data_class::getList();
while ($arData = $rsData->fetch()) {
$arValues[$arData['ID']] = array('ID' => $arData['ID'], 'NAME' => $arData['UF_NAME'], 'SORT' => $arData['UF_SORT'], 'FILE' => $arData['UF_FILE'], 'PICT' => '', 'XML_ID' => $arData['UF_XML_ID']);
}
$arRes[$skuIblockID][$arProp['ID']]['VALUES'] = $arValues;
}
}
}
}
}
}
foreach ($arBasketItems as &$arItem) {
// catalog-specific logic farther: iblocks, catalogs and other friends
if (!$this->cameFromCatalog($arItem)) {
continue;
}
$arSelectSkuProps = array();
foreach ($arSkuProps as $prop) {
$arSelectSkuProps[] = "PROPERTY_" . $prop;
}
if (isset($arItem["IBLOCK_ID"]) && intval($arItem["IBLOCK_ID"]) > 0 && array_key_exists($arItem["IBLOCK_ID"], $arRes)) {
$arItem["SKU_DATA"] = $arRes[$arItem["IBLOCK_ID"]];
$arUsedValues = array();
$arTmpRes = array();
$arOfFilter = array("IBLOCK_ID" => $arItem["IBLOCK_ID"], "PROPERTY_" . $arSkuIblockID[$arItem["IBLOCK_ID"]]["SKU_PROPERTY_ID"] => $arParents[$arItem["PRODUCT_ID"]]["PRODUCT_ID"]);
$rsOffers = CIBlockElement::GetList(array(), $arOfFilter, false, false, array_merge(array("ID"), $arSelectSkuProps));
while ($arOffer = $rsOffers->GetNext()) {
foreach ($arSkuProps as $prop) {
if (!empty($arOffer["PROPERTY_" . $prop . "_VALUE"]) && (!is_array($arUsedValues[$arItem["PRODUCT_ID"]][$prop]) || !in_array($arOffer["PROPERTY_" . $prop . "_VALUE"], $arUsedValues[$arItem["PRODUCT_ID"]][$prop]))) {
$arUsedValues[$arItem["PRODUCT_ID"]][$prop][] = $arOffer["PROPERTY_" . $prop . "_VALUE"];
}
}
}
if (!empty($arUsedValues)) {
// add only used values to the item SKU_DATA
foreach ($arRes[$arItem["IBLOCK_ID"]] as $propId => $arProp) {
if (!array_key_exists($arProp["CODE"], $arUsedValues[$arItem["PRODUCT_ID"]])) {
//.........这里部分代码省略.........
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:101,代码来源:class.php
示例19: intval
$arEnum['ID'] = intval($arEnum['ID']);
$arValues[$arEnum['ID']] = array('ID' => $arEnum['ID'], 'NAME' => $arEnum['NAME'], 'SORT' => intval($arEnum['SORT']), 'PICT' => array('SRC' => $arEnum['PREVIEW_PICTURE']['SRC'], 'WIDTH' => intval($arEnum['PREVIEW_PICTURE']['WIDTH']), 'HEIGHT' => intval($arEnum['PREVIEW_PICTURE']['HEIGHT'])));
}
$arValues[0] = array('ID' => 0, 'SORT' => PHP_INT_MAX, 'NA' => true, 'NAME' => '', 'PICT' => $arEmptyPreview);
$arOneSKU['VALUES'] = $arValues;
$arOneSKU['VALUES_COUNT'] = count($arValues);
} else {
$hlblock = \Bitrix\Highloadblock\HighloadBlockTable::getList(array("filter" => array('TABLE_NAME' => $arProp['USER_TYPE_SETTINGS']['TABLE_NAME'])))->fetch();
if (!isset($hlblock['ID'])) {
continue;
}
$arValues = array();
$arXmlMap = array();
$boolName = true;
$boolPict = true;
$entity = \Bitrix\Highloadblock\HighloadBlockTable::compileEntity($hlblock);
$entity_data_class = $entity->getDataClass();
$rsPropEnums = $entity_data_class::getList(array());
while ($arEnum = $rsPropEnums->fetch()) {
if (!isset($arEnum['UF_NAME'])) {
$boolName = false;
break;
}
$arEnum['PREVIEW_PICTURE'] = false;
if (!isset($arEnum['UF_FILE'])) {
$boolPict = false;
}
if ($boolPict) {
$arEnum['PREVIEW_PICTURE'] = CFile::GetFileArray($arEnum['UF_FILE']);
}
$arEnum['ID'] = intval($arEnum['ID']);
开发者ID:Andreyjktl,项目名称:kidster,代码行数:31,代码来源:result_modifier.php
示例20: array
);
if ($dbHblock->Fetch())
return;
$data = array(
'NAME' => 'ColorReference',
'TABLE_NAME' => 'eshop_color_reference',
);
$result = HL\HighloadBlockTable::add($data);
$ID = $result->getId();
$_SESSION["ESHOP_HBLOCK_ID"] = $ID;
$hldata = HL\HighloadBlockTable::getById($ID)->fetch();
$hlentity = HL\HighloadBlockTable::compileEntity($hldata);
//adding user fields
$arUserFields = array (
array (
'ENTITY_ID' => 'HLBLOCK_'.$ID,
'FIELD_NAME' => 'UF_NAME',
'USER_TYPE_ID' => 'string',
'XML_ID' => 'UF_COLOR_NAME',
'SORT' => '100',
'MULTIPLE' => 'N',
'MANDATORY' => 'N',
'SHOW_FILTER' => 'N',
'SHOW_IN_LIST' => 'Y',
'EDIT_IN_LIST' => 'Y',
'IS_SEARCHABLE' => 'Y',
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:31,代码来源:references.php
注:本文中的Bitrix\Highloadblock\HighloadBlockTable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论