本文整理匯總了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;
}