本文整理汇总了PHP中Mage_Catalog_Model_Abstract::getStore方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Abstract::getStore方法的具体用法?PHP Mage_Catalog_Model_Abstract::getStore怎么用?PHP Mage_Catalog_Model_Abstract::getStore使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Catalog_Model_Abstract
的用法示例。
在下文中一共展示了Mage_Catalog_Model_Abstract::getStore方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetStore
public function testGetStore()
{
$store = $this->_model->getStore();
$this->assertSame($store, Mage::app()->getStore());
}
示例2: _lockAttributes
/**
* Lock the attributes of a product/category so that it can not be overwritten using Magento's backend.
* @param Mage_Catalog_Model_Abstract $model
*/
protected function _lockAttributes(Mage_Catalog_Model_Abstract $model)
{
// Is product assigned to import profile.
if (!($profiles = $model->getData('ho_import_profile'))) {
return;
}
foreach ($profiles as $profileData) {
$profile = $profileData['profile'];
// Is lock attributes functionality enabled.
$lockAttributes = sprintf('global/ho_import/%s/import_options/lock_attributes', $profile);
$fieldMapNode = Mage::getConfig()->getNode($lockAttributes);
if (!$fieldMapNode || !$fieldMapNode->asArray()) {
continue;
}
// Get the mapper.
/** @var Ho_Import_Model_Mapper $mapper */
$mapper = Mage::getModel('ho_import/mapper');
$mapper->setProfileName($profile);
$storeCode = $model->getStore()->getCode();
// Check if attributes need to be locked.
$attributes = $model->getAttributes();
foreach ($attributes as $attribute) {
/** @var Mage_Catalog_Model_Resource_Eav_Attribute $attribute */
$mapper->setStoreCode($attribute->isScopeStore() || $attribute->isScopeWebsite() ? $storeCode : 'admin');
$fieldConfig = $mapper->getFieldConfig($attribute->getAttributeCode());
if (isset($fieldConfig['@'])) {
$this->_lockAttribute($attribute, $model, $profile);
}
}
}
}