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


PHP Category::getStoreIds方法代码示例

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


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

示例1: generateForGlobalScope

 /**
  * Generate list of urls for global scope
  *
  * @return \Magento\UrlRewrite\Service\V1\Data\UrlRewrite[]
  */
 protected function generateForGlobalScope()
 {
     $urls = [];
     $categoryId = $this->category->getId();
     foreach ($this->category->getStoreIds() as $id) {
         if (!$this->isGlobalScope($id) && !$this->storeViewService->doesEntityHaveOverriddenUrlKeyForStore($id, $categoryId, Category::ENTITY)) {
             $urls = array_merge($urls, $this->generateForSpecificStoreView($id));
         }
     }
     return $urls;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:16,代码来源:CategoryUrlRewriteGenerator.php

示例2: generateForGlobalScope

 /**
  * Generate list of urls for global scope
  *
  * @return \Magento\UrlRewrite\Service\V1\Data\UrlRewrite[]
  */
 protected function generateForGlobalScope()
 {
     $urls = [];
     $categoryId = $this->category->getId();
     foreach ($this->category->getStoreIds() as $storeId) {
         if (!$this->isGlobalScope($storeId) && $this->isOverrideUrlsForStore($storeId, $categoryId)) {
             $this->updateCategoryUrlForStore($storeId);
             $urls = array_merge($urls, $this->generateForSpecificStoreView($storeId));
         }
     }
     return $urls;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:17,代码来源:CategoryUrlRewriteGenerator.php

示例3: testGetStoreIds

 public function testGetStoreIds()
 {
     $this->_model = $this->getCategoryByName('Category 1.1');
     /* id from fixture */
     $this->assertContains(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Store\\Model\\StoreManagerInterface')->getStore()->getId(), $this->_model->getStoreIds());
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:6,代码来源:CategoryTest.php

示例4: testGetStoreIds

 public function testGetStoreIds()
 {
     $this->_model->load(3);
     /* id from fixture */
     $this->assertContains(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\\Framework\\StoreManagerInterface')->getStore()->getId(), $this->_model->getStoreIds());
 }
开发者ID:buskamuza,项目名称:magento2-skeleton,代码行数:6,代码来源:CategoryTest.php

示例5: getStoreIds

 /**
  * {@inheritdoc}
  */
 public function getStoreIds()
 {
     $pluginInfo = $this->pluginList->getNext($this->subjectType, 'getStoreIds');
     if (!$pluginInfo) {
         return parent::getStoreIds();
     } else {
         return $this->___callPlugins('getStoreIds', func_get_args(), $pluginInfo);
     }
 }
开发者ID:HaonanXu,项目名称:der-snack-backup,代码行数:12,代码来源:Interceptor.php

示例6: getProductSorterLoadUrl

 /**
  * Retrieve the category product sorter load URL.
  *
  * @param Category $category Category.
  *
  * @return string
  */
 private function getProductSorterLoadUrl(Category $category)
 {
     $storeId = $category->getStoreId();
     if ($storeId === 0) {
         $defaultStoreId = $this->storeManager->getDefaultStoreView()->getId();
         $storeId = current(array_filter($category->getStoreIds()));
         if (in_array($defaultStoreId, $category->getStoreIds())) {
             $storeId = $defaultStoreId;
         }
     }
     $urlParams = ['ajax' => true, 'store' => $storeId];
     return $this->urlBuilder->getUrl('virtualcategory/category_virtual/preview', $urlParams);
 }
开发者ID:smile-sa,项目名称:elasticsuite,代码行数:20,代码来源:DataProviderPlugin.php


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