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


PHP Mage_Core_Model_App::getWebsites方法代码示例

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


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

示例1: _initWebsites

 /**
  * Initialize website values
  *
  * @param bool $withDefault
  * @return Mage_ImportExport_Model_Import_Entity_EavAbstract
  */
 protected function _initWebsites($withDefault = false)
 {
     /** @var $website Mage_Core_Model_Website */
     foreach ($this->_websiteManager->getWebsites($withDefault) as $website) {
         $this->_websiteCodeToId[$website->getCode()] = $website->getId();
     }
     return $this;
 }
开发者ID:,项目名称:,代码行数:14,代码来源:

示例2: getWebsites

 /**
  * Get websites
  *
  * @return array
  */
 public function getWebsites()
 {
     $websites = $this->_application->getWebsites();
     if ($websiteIds = $this->getWebsiteIds()) {
         foreach ($websites as $websiteId => $website) {
             if (!in_array($websiteId, $websiteIds)) {
                 unset($websites[$websiteId]);
             }
         }
     }
     return $websites;
 }
开发者ID:nickimproove,项目名称:magento2,代码行数:17,代码来源:Switcher.php

示例3: _checkSingleStoreMode

 /**
  * Set correct scope if isSingleStoreMode = true
  *
  * @param Mage_Backend_Model_Config_Structure_Element_Field $fieldConfig
  * @param Mage_Core_Model_Config_Data $dataObject
  */
 protected function _checkSingleStoreMode(Mage_Backend_Model_Config_Structure_Element_Field $fieldConfig, $dataObject)
 {
     $isSingleStoreMode = $this->_application->isSingleStoreMode();
     if (!$isSingleStoreMode) {
         return;
     }
     if (!$fieldConfig->showInDefault()) {
         $websites = $this->_application->getWebsites();
         $singleStoreWebsite = array_shift($websites);
         $dataObject->setScope('websites');
         $dataObject->setWebsiteCode($singleStoreWebsite->getCode());
         $dataObject->setScopeId($singleStoreWebsite->getId());
     }
 }
开发者ID:,项目名称:,代码行数:20,代码来源:

示例4: _checkSingleStoreMode

 /**
  * Set correct scope if isSingleStoreMode = true
  *
  * @param array $fieldConfig
  * @param Mage_Core_Model_Config_Data $dataObject
  */
 protected function _checkSingleStoreMode($fieldConfig, $dataObject)
 {
     $isSingleStoreMode = $this->_application->isSingleStoreMode();
     if (!$isSingleStoreMode) {
         return;
     }
     if (!isset($fieldConfig['showInDefault']) || !(int) $fieldConfig['showInDefault']) {
         $websites = $this->_application->getWebsites();
         $singleStoreWebsite = array_shift($websites);
         $dataObject->setScope('websites');
         $dataObject->setWebsiteCode($singleStoreWebsite->getCode());
         $dataObject->setScopeId($singleStoreWebsite->getId());
     }
 }
开发者ID:nickimproove,项目名称:magento2,代码行数:20,代码来源:Config.php

示例5: execute

 /**
  * Run reindex
  */
 public function execute()
 {
     $this->_app->dispatchEvent('catalogrule_before_apply', array('resource' => $this->_resource));
     /** @var $coreDate Mage_Core_Model_Date */
     $coreDate = $this->_factory->getModel('core/date');
     $timestamp = $coreDate->gmtTimestamp('Today');
     foreach ($this->_app->getWebsites(false) as $website) {
         /** @var $website Mage_Core_Model_Website */
         if ($website->getDefaultStore()) {
             $this->_reindex($website, $timestamp);
         }
     }
     $this->_prepareGroupWebsite($timestamp);
     $this->_prepareAffectedProduct();
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:18,代码来源:Refresh.php

示例6: testGetWebsites

 public function testGetWebsites()
 {
     $this->assertNotEmpty($this->_mageModel->getWebsites());
     $this->assertNotContains(0, array_keys($this->_mageModel->getWebsites()));
     $this->assertContains(0, array_keys($this->_mageModel->getWebsites(true)));
 }
开发者ID:nemphys,项目名称:magento2,代码行数:6,代码来源:AppTest.php

示例7: _getWebsitesMap

 /**
  * Prepare website to default assigned store map
  *
  * @return array
  */
 protected function _getWebsitesMap()
 {
     $map = array();
     foreach ($this->_app->getWebsites(true) as $website) {
         if ($website->getDefaultStore()) {
             $map[$website->getId()] = $website->getDefaultStore()->getId();
         }
     }
     return $map;
 }
开发者ID:okite11,项目名称:frames21,代码行数:15,代码来源:Rule.php


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