当前位置: 首页>>代码示例>>PHP>>正文


PHP CCurrency::getList方法代码示例

本文整理汇总了PHP中CCurrency::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP CCurrency::getList方法的具体用法?PHP CCurrency::getList怎么用?PHP CCurrency::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CCurrency的用法示例。


在下文中一共展示了CCurrency::getList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getReferences

 /**
  * Get common data from cache.
  * @return mixed[]
  */
 protected function getReferences()
 {
     global $USER;
     $this->arParams['CACHE_GROUPS'] = isset($this->arParams['CACHE_GROUPS']) && $this->arParams['CACHE_GROUPS'] == 'N' ? 'N' : 'Y';
     $obCache = new CPHPCache();
     if ($this->arParams['CACHE_GROUPS'] == 'Y') {
         $cacheId = implode("-", array(__CLASS__, LANGUAGE_ID, SITE_ID, $USER->GetGroups()));
     } else {
         $cacheId = implode("-", array(__CLASS__, LANGUAGE_ID, SITE_ID));
     }
     $cached = array();
     if ($obCache->StartDataCache($this->arParams["CACHE_TIME"], $cacheId, SITE_ID . '/' . $this->getRelativePath() . '/reference')) {
         // Catalog Groups
         $cached['CATALOG_GROUP'] = array();
         $catalogGroupIterator = CCatalogGroup::GetList(array("SORT" => "ASC"));
         while ($catalogGroup = $catalogGroupIterator->fetch()) {
             $cached['CATALOG_GROUP'][$catalogGroup['NAME']] = $catalogGroup;
         }
         // Catalog Prices
         $cached['CATALOG_PRICE'] = CIBlockPriceTools::GetCatalogPrices(false, array_keys($cached['CATALOG_GROUP']));
         // Catalog Currency
         $cached['CURRENCY'] = array();
         if ($this->isCurrency) {
             $by = "currency";
             $order = "asc";
             $currencyIterator = CCurrency::getList($by, $order);
             while ($currency = $currencyIterator->fetch()) {
                 $cached['CURRENCY'][$currency['CURRENCY']] = $currency;
             }
         }
         // Catalogs list
         $cached['CATALOG'] = array();
         $catalogIterator = CCatalog::getList(array("IBLOCK_ID" => "ASC"));
         while ($catalog = $catalogIterator->fetch()) {
             $info = CCatalogSku::getInfoByIblock($catalog['IBLOCK_ID']);
             $catalog['CATALOG_TYPE'] = $info['CATALOG_TYPE'];
             $cached['CATALOG'][$catalog['IBLOCK_ID']] = $catalog;
         }
         // Measure list
         $cached['MEASURE'] = array();
         $measureIterator = CCatalogMeasure::getList(array("CODE" => "ASC"));
         while ($measure = $measureIterator->fetch()) {
             $cached['MEASURE'][$measure['ID']] = $measure;
         }
         // Default Measure
         $cached['DEFAULT_MEASURE'] = CCatalogMeasure::getDefaultMeasure(true, true);
         $obCache->EndDataCache($cached);
     } else {
         $cached = $obCache->GetVars();
     }
     return $cached;
 }
开发者ID:akniyev,项目名称:arteva.ru,代码行数:56,代码来源:class.php

示例2: getReferences

 /**
  * Get common data from cache.
  * @return mixed[]
  */
 protected function getReferences()
 {
     $this->arParams['CACHE_GROUPS'] = isset($this->arParams['CACHE_GROUPS']) && $this->arParams['CACHE_GROUPS'] == 'N' ? 'N' : 'Y';
     $obCache = new CPHPCache();
     if ($this->arParams['CACHE_GROUPS'] == 'Y') {
         $userGroups = implode(",", Main\UserTable::getUserGroupIds($this->getUserId()));
         $cacheId = implode("-", array(__CLASS__, $this->getLanguageId(), $this->getSiteId(), $userGroups));
     } else {
         $cacheId = implode("-", array(__CLASS__, $this->getLanguageId(), $this->getSiteId()));
     }
     $cached = array();
     if ($obCache->StartDataCache($this->arParams["CACHE_TIME"], $cacheId, $this->getSiteId() . '/' . $this->getRelativePath() . '/reference')) {
         // Catalog Groups
         $cached['CATALOG_GROUP'] = array();
         $catalogGroupIterator = CCatalogGroup::GetList(array("SORT" => "ASC"));
         while ($catalogGroup = $catalogGroupIterator->fetch()) {
             $cached['CATALOG_GROUP'][$catalogGroup['NAME']] = $catalogGroup;
         }
         // Catalog Prices
         $cached['CATALOG_PRICE'] = CIBlockPriceTools::GetCatalogPrices(false, array_keys($cached['CATALOG_GROUP']));
         // Catalog Currency
         $cached['CURRENCY'] = array();
         if ($this->isCurrency) {
             $by = "currency";
             $order = "asc";
             $currencyIterator = CCurrency::getList($by, $order);
             while ($currency = $currencyIterator->fetch()) {
                 $cached['CURRENCY'][$currency['CURRENCY']] = $currency;
             }
         }
         // Catalogs list
         $cached['CATALOG'] = array();
         $catalogIterator = CCatalog::getList(array("IBLOCK_ID" => "ASC"));
         while ($catalog = $catalogIterator->fetch()) {
             $info = CCatalogSku::getInfoByIblock($catalog['IBLOCK_ID']);
             $catalog['CATALOG_TYPE'] = $info['CATALOG_TYPE'];
             $cached['CATALOG'][$catalog['IBLOCK_ID']] = $catalog;
         }
         // Measure list
         $cached['MEASURE'] = array();
         $measureIterator = CCatalogMeasure::getList(array("CODE" => "ASC"));
         while ($measure = $measureIterator->fetch()) {
             $cached['MEASURE'][$measure['ID']] = $measure;
         }
         // Default Measure
         $cached['DEFAULT_MEASURE'] = CCatalogMeasure::getDefaultMeasure(true, true);
         $additionalCache = $this->getAdditionalRefereneces();
         if (!empty($additionalCache) && is_array($additionalCache)) {
             foreach ($additionalCache as $cacheKey => $cacheData) {
                 $cached[$cacheKey] = $cacheData;
             }
             unset($cacheKey, $cacheData);
         }
         unset($additionalCache);
         $obCache->EndDataCache($cached);
     } else {
         $cached = $obCache->GetVars();
     }
     return $cached;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:64,代码来源:class.php


注:本文中的CCurrency::getList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。