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


PHP StoreManager::getStores方法代码示例

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


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

示例1: cleanAbandonedCartExpiredCoupons

 public function cleanAbandonedCartExpiredCoupons()
 {
     $allStores = $this->_storeManager->getStores();
     foreach ($allStores as $storeId => $val) {
         if ($this->_helper->getConfig(Ebizmarts_AbandonedCart_Model_Config::ACTIVE, $storeId)) {
             $this->_cleanCoupons($storeId);
         }
     }
 }
开发者ID:lazyguru,项目名称:magento2-abandonedcart,代码行数:9,代码来源:Cron.php

示例2: process

 /**
  *
  */
 public function process()
 {
     foreach ($this->_storeManager->getStores() as $storeId => $val) {
         $this->_storeManager->setCurrentStore($storeId);
         if ($this->_helper->getConfig(Config::ACTIVE, $storeId)) {
             $this->_processStore($storeId);
         }
     }
 }
开发者ID:ebizmarts,项目名称:magento2-autoresponder,代码行数:12,代码来源:Cron.php

示例3: getAllUrls

 /**
  * Get urls of all the stores in the magento install.
  *
  * @return array
  */
 public function getAllUrls()
 {
     $urls = [];
     $stores = $this->storeManager->getStores(false);
     foreach ($stores as $store) {
         $urls[] = $store->getBaseUrl();
     }
     return $urls;
 }
开发者ID:eonsequeira,项目名称:HS_All,代码行数:14,代码来源:Data.php

示例4: execute

 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     if ($input->getOption('remove')) {
         $store = $input->getOption('store');
         $collection = $this->synonymFactory->create()->getCollection();
         if ($store) {
             $collection->addFieldToFilter('store_id', $store);
         }
         $cnt = 0;
         foreach ($collection as $item) {
             $item->delete();
             $cnt++;
             if ($cnt % 1000 == 0) {
                 $output->writeln("<info>{$cnt} synonyms are removed...</info>");
             }
         }
         $output->writeln("<info>{$cnt} synonyms are removed.</info>");
         return;
     }
     if ($input->getOption('file') && $input->getOption('store')) {
         $file = $this->config->getSynonymDirectoryPath() . DIRECTORY_SEPARATOR . $input->getOption('file');
         $store = $input->getOption('store');
         $result = $this->synonymFactory->create()->import($file, $store);
         $output->writeln("<info>Imported {$result['synonyms']} synonyms</info>");
     } else {
         $output->writeln('<info>Available files:</info>');
         foreach ($this->synonymFactory->create()->getAvailableFiles() as $file) {
             $info = pathinfo($file);
             $output->writeln("    {$info['basename']}");
         }
         $output->writeln('<info>Available stores:</info>');
         foreach ($this->storeManager->getStores(true) as $store) {
             $output->writeln("    {$store->getId()} [{$store->getCode()}]");
         }
     }
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:39,代码来源:SynonymCommand.php

示例5: getStores

 /**
  * {@inheritdoc}
  */
 public function getStores($withDefault = false, $codeKey = false)
 {
     $result = $this->decoratedStoreManager->getStores($withDefault, $codeKey);
     $this->dispatchInitCurrentStoreAfterEvent();
     return $result;
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:9,代码来源:StoreManager.php

示例6: testGetStores

 /**
  * @dataProvider getStoresDataProvider
  */
 public function testGetStores($storesList, $withDefault, $codeKey, $expectedStores)
 {
     $this->storeRepositoryMock->expects($this->any())->method('getList')->willReturn($storesList);
     $this->assertEquals($expectedStores, $this->model->getStores($withDefault, $codeKey));
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:8,代码来源:StoreManagerTest.php


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