本文整理汇总了PHP中CCatalogSKU::getInfoByProductIBlock方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogSKU::getInfoByProductIBlock方法的具体用法?PHP CCatalogSKU::getInfoByProductIBlock怎么用?PHP CCatalogSKU::getInfoByProductIBlock使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogSKU
的用法示例。
在下文中一共展示了CCatalogSKU::getInfoByProductIBlock方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param integer $iblockId Information block identifier.
* @param integer $elementId Element identifier.
*
* @throws \Bitrix\Main\LoaderException
*/
public function __construct($iblockId, $elementId)
{
$this->iblockId = intval($iblockId);
$this->elementId = intval($elementId);
if (self::$catalog === null) {
self::$catalog = \Bitrix\Main\Loader::includeModule("catalog");
}
if (self::$catalog) {
$catalog = \CCatalogSKU::getInfoByProductIBlock($this->iblockId);
if (!empty($catalog) && is_array($catalog)) {
$this->skuIblockId = $catalog["IBLOCK_ID"];
$this->skuPropertyId = $catalog["SKU_PROPERTY_ID"];
}
}
}
示例2: init
/**
* Initializes internal object state. Must be called before usage.
*
* @throws \Bitrix\Main\LoaderException
* @return void
*/
public function init()
{
$this->dictionary = new Dictionary($this->iblockId);
$this->storage = new Storage($this->iblockId);
if (self::$catalog === null) {
self::$catalog = \Bitrix\Main\Loader::includeModule("catalog");
}
if (self::$catalog) {
$catalog = \CCatalogSKU::getInfoByProductIBlock($this->iblockId);
if (!empty($catalog) && is_array($catalog)) {
$this->skuIblockId = $catalog["IBLOCK_ID"];
$this->skuPropertyId = $catalog["SKU_PROPERTY_ID"];
}
}
}
示例3: __construct
/**
* @param integer $iblockId Information block identifier.
*/
public function __construct($iblockId)
{
$this->iblockId = intval($iblockId);
$this->valid = \CIBlock::getArrayByID($this->iblockId, "PROPERTY_INDEX") === "Y";
if (Loader::includeModule("catalog")) {
$catalogInfo = \CCatalogSKU::getInfoByProductIBlock($this->iblockId);
if (!empty($catalogInfo) && is_array($catalogInfo)) {
$this->skuIblockId = $catalogInfo["IBLOCK_ID"];
$this->skuPropertyId = $catalogInfo["SKU_PROPERTY_ID"];
$this->valid = $this->valid && \CIBlock::getArrayByID($this->skuIblockId, "PROPERTY_INDEX") === "Y";
}
}
$this->dictionary = new \Bitrix\Iblock\PropertyIndex\Dictionary($this->iblockId);
$this->storage = new \Bitrix\Iblock\PropertyIndex\Storage($this->iblockId);
}
示例4: __construct
/**
* @param integer $iblockId Information block identifier.
*/
public function __construct($iblockId)
{
$this->iblockId = intval($iblockId);
$this->valid = \CIBlock::getArrayByID($this->iblockId, "PROPERTY_INDEX") === "Y";
if (self::$catalog === null) {
self::$catalog = \Bitrix\Main\Loader::includeModule("catalog");
}
if (self::$catalog) {
$catalogInfo = \CCatalogSKU::getInfoByProductIBlock($this->iblockId);
if (!empty($catalogInfo) && is_array($catalogInfo)) {
$this->skuIblockId = $catalogInfo["IBLOCK_ID"];
$this->skuPropertyId = $catalogInfo["SKU_PROPERTY_ID"];
$this->valid = $this->valid && \CIBlock::getArrayByID($this->skuIblockId, "PROPERTY_INDEX") === "Y";
}
}
$this->dictionary = new Dictionary($this->iblockId);
$this->storage = new Storage($this->iblockId);
$this->valid = $this->valid && $this->dictionary->isExists();
}
示例5: loadFromDatabase
public function loadFromDatabase()
{
if (!isset($this->fields)) {
$this->fields = array();
$select = array_values($this->fieldMap);
$elementList = \Freetrix\Iblock\ElementTable::getList(array("select" => $select, "filter" => array("=ID" => $this->id)));
$this->elementFields = $elementList->fetch();
if ($this->elementFields) {
$arCatalog = \CCatalogSKU::getInfoByProductIBlock($this->elementFields["IBLOCK_ID"]);
if (is_array($arCatalog)) {
$this->skuIblockId = $arCatalog["IBLOCK_ID"];
$skuList = \CIBlockElement::getList(array(), array("IBLOCK_ID" => $arCatalog["IBLOCK_ID"], "=PROPERTY_" . $arCatalog["SKU_PROPERTY_ID"] => $this->id), false, false, $select);
while ($sku = $skuList->fetch()) {
$this->skuList[] = $sku;
foreach ($sku as $fieldName => $fieldValue) {
$this->fields[$fieldName][] = $fieldValue;
}
}
}
}
}
return is_array($this->fields);
}
示例6: getOffersCatalog
protected function getOffersCatalog($iblockId)
{
if (self::$catalogIncluded === null) {
self::$catalogIncluded = Main\Loader::includeModule('catalog');
}
if (!self::$catalogIncluded) {
return array();
}
if (!isset(static::$offersCatalog[$iblockId])) {
static::$offersCatalog[$iblockId] = \CCatalogSKU::getInfoByProductIBlock($iblockId);
}
return static::$offersCatalog[$iblockId];
}