本文整理汇总了PHP中CCatalogSKU::GetCatalogTypes方法的典型用法代码示例。如果您正苦于以下问题:PHP CCatalogSKU::GetCatalogTypes方法的具体用法?PHP CCatalogSKU::GetCatalogTypes怎么用?PHP CCatalogSKU::GetCatalogTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CCatalogSKU
的用法示例。
在下文中一共展示了CCatalogSKU::GetCatalogTypes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOfferObject
public static function getOfferObject(array $offerParams)
{
if (!isset($offerParams["IBLOCK_ID"]) || intval($offerParams["IBLOCK_ID"]) <= 0) {
throw new SystemException("Incorrect iBlock ID (" . __CLASS__ . "::" . __METHOD__ . ")");
}
$arCatalog = \CCatalog::GetByIDExt($offerParams["IBLOCK_ID"]);
if (empty($arCatalog)) {
throw new SystemException("IBlock is not catalog. (" . __CLASS__ . "::" . __METHOD__ . ")");
}
$catalogType = $arCatalog["CATALOG_TYPE"];
$catalogTypes = \CCatalogSKU::GetCatalogTypes();
if (!in_array($catalogType, $catalogTypes)) {
throw new SystemException("Unknown type of catalog (" . __CLASS__ . "::" . __METHOD__ . ")");
}
$result = array();
switch ($catalogType) {
case \CCatalogSKU::TYPE_CATALOG:
case \CCatalogSKU::TYPE_OFFERS:
$result = new ExportOffer($catalogType, $offerParams);
break;
case \CCatalogSKU::TYPE_PRODUCT:
case \CCatalogSKU::TYPE_FULL:
$result = new ExportOfferSKU($catalogType, $offerParams);
break;
}
return $result;
}