本文整理汇总了PHP中Mage_Eav_Model_Entity_Attribute_Abstract::getAttribute方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Eav_Model_Entity_Attribute_Abstract::getAttribute方法的具体用法?PHP Mage_Eav_Model_Entity_Attribute_Abstract::getAttribute怎么用?PHP Mage_Eav_Model_Entity_Attribute_Abstract::getAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Eav_Model_Entity_Attribute_Abstract
的用法示例。
在下文中一共展示了Mage_Eav_Model_Entity_Attribute_Abstract::getAttribute方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _isCallableAttributeInstance
/**
* Check whether attribute instance (attribute, backend, frontend or source) has method and applicable
*
* @param Mage_Eav_Model_Entity_Attribute_Abstract|Mage_Eav_Model_Entity_Attribute_Backend_Abstract|Mage_Eav_Model_Entity_Attribute_Frontend_Abstract|Mage_Eav_Model_Entity_Attribute_Source_Abstract $instance
* @param string $method
* @param array $args array of arguments
* @return boolean
*/
protected function _isCallableAttributeInstance($instance, $method, $args)
{
if ($instance instanceof Mage_Eav_Model_Entity_Attribute_Backend_Abstract && ($method == 'beforeSave' || ($method = 'afterSave'))) {
$attributeCode = $instance->getAttribute()->getAttributeCode();
if (isset($args[0]) && $args[0] instanceof Varien_Object && $args[0]->getData($attributeCode) === false) {
return false;
}
}
return parent::_isCallableAttributeInstance($instance, $method, $args);
}
示例2: _isCallableAttributeInstance
/**
* Check whether attribute instance (attribute, backend, frontend or source) has method and applicable
*
* @param Mage_Eav_Model_Entity_Attribute_Abstract|Mage_Eav_Model_Entity_Attribute_Backend_Abstract|Mage_Eav_Model_Entity_Attribute_Frontend_Abstract|Mage_Eav_Model_Entity_Attribute_Source_Abstract $instance
* @param string $method
* @param array $args array of arguments
* @return boolean
*/
protected function _isCallableAttributeInstance($instance, $method, $args)
{
if ($instance instanceof Mage_Eav_Model_Entity_Attribute_Backend_Abstract && ($method == 'beforeSave' || ($method = 'afterSave'))) {
$attributeCode = $instance->getAttribute()->getAttributeCode();
if (isset($args[0]) && $args[0] instanceof Varien_Object && $args[0]->getData($attributeCode) === false) {
return false;
}
}
if (!is_object($instance) || !method_exists($instance, $method)) {
return false;
}
if (method_exists(get_parent_class(__CLASS__), '_isCallableAttributeInstance')) {
return parent::_isCallableAttributeInstance($instance, $method, $args);
} else {
return true;
}
}