本文整理汇总了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;
}
示例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;
}
示例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());
}
示例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());
}
示例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);
}
}
示例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);
}