當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。