本文整理汇总了PHP中Mage_Catalog_Model_Resource_Eav_Attribute::getIsVisible方法的典型用法代码示例。如果您正苦于以下问题:PHP Mage_Catalog_Model_Resource_Eav_Attribute::getIsVisible方法的具体用法?PHP Mage_Catalog_Model_Resource_Eav_Attribute::getIsVisible怎么用?PHP Mage_Catalog_Model_Resource_Eav_Attribute::getIsVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mage_Catalog_Model_Resource_Eav_Attribute
的用法示例。
在下文中一共展示了Mage_Catalog_Model_Resource_Eav_Attribute::getIsVisible方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _isAttributeVisible
/**
* Define if attribute should be visible for passed user type
*
* @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute
* @param string $userType
* @return bool
*/
protected function _isAttributeVisible(Mage_Catalog_Model_Resource_Eav_Attribute $attribute, $userType)
{
$isAttributeVisible = false;
if ($userType == Mage_Api2_Model_Auth_User_Admin::USER_TYPE) {
$isAttributeVisible = $attribute->getIsVisible();
} else {
$systemAttributesForNonAdmin = array('sku', 'name', 'short_description', 'description', 'tier_price', 'meta_title', 'meta_description', 'meta_keyword');
if ($attribute->getIsUserDefined()) {
$isAttributeVisible = $attribute->getIsVisibleOnFront();
} else {
if (in_array($attribute->getAttributeCode(), $systemAttributesForNonAdmin)) {
$isAttributeVisible = true;
}
}
}
return (bool) $isAttributeVisible;
}
示例2: canUseAttribute
/**
* Check attribute availability for super product creation
*
* @param Mage_Catalog_Model_Resource_Eav_Attribute $attribute
* @return bool
*/
public function canUseAttribute(Mage_Catalog_Model_Resource_Eav_Attribute $attribute)
{
return $attribute->getIsGlobal() == Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL && $attribute->getIsVisible() && $attribute->getIsConfigurable() && $attribute->usesSource() && $attribute->getIsUserDefined();
}
示例3: _isAllowedAttribute
/**
* Check if specified attribute is allowed.
* List of allowed attributes has higher priority over list of ignored and
* blacklisted attributes.
*
* @param Mage_Catalog_Model_Resource_Eav_Attribute $attr Atrribute
* @param array $allow Key based list of allowed attributes
* @param array $ignore Key based list of attributes to ignore
*/
protected function _isAllowedAttribute($attr, $allow = array(), $ignore = array())
{
$code = $attr->getAttributeCode();
if ($allow && !isset($allow[$code]) || isset($ignore[$code]) || isset($this->_blacklist[$code])) {
return false;
}
return $attr->getIsVisible() || isset($this->_whitelist[$code]);
}