本文整理汇总了PHP中Mage_Catalog_Model_Category::getStoreIds方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Category::getStoreIds方法的具体用法?PHP Mage_Catalog_Model_Category::getStoreIds怎么用?PHP Mage_Catalog_Model_Category::getStoreIds使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Catalog_Model_Category
的用法示例。
在下文中一共展示了Mage_Catalog_Model_Category::getStoreIds方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetStoreIds
public function testGetStoreIds()
{
$this->_model->load(3);
/* id from fixture */
$this->assertContains(Mage::app()->getStore()->getId(), $this->_model->getStoreIds());
}
示例2: catalogCategorySaveBefore
/**
* Validate catalog category save
*
* @param Mage_Catalog_Model_Category $model
*/
public function catalogCategorySaveBefore($model)
{
if (!$model->getId()) {
return;
}
// No saving to wrong stores
if (!$this->_role->hasStoreAccess($model->getStoreIds())) {
$this->_throwSave();
}
// No saving under disallowed root categories
$categoryPath = $model->getPath();
$allowed = false;
foreach ($this->_role->getAllowedRootCategories() as $rootPath) {
if ($categoryPath != $rootPath) {
if (0 === strpos($categoryPath, "{$rootPath}/")) {
$allowed = true;
}
} else {
if ($this->_role->hasExclusiveCategoryAccess($rootPath)) {
$allowed = true;
}
}
if ($allowed) {
break;
}
}
if (!$allowed) {
$this->_throwSave();
}
}