Public Member Functions | |
isScopeGlobal () | |
isScopeWebsite () | |
isScopeStore () | |
getStoreId () | |
getApplyTo () | |
getSourceModel () | |
isAllowedForRuleCondition () | |
getFrontendLabel () | |
_getDefaultSourceModel () | |
Static Public Member Functions | |
static | initLabels ($storeId=null) |
Public Attributes | |
const | SCOPE_STORE = 0 |
const | SCOPE_GLOBAL = 1 |
const | SCOPE_WEBSITE = 2 |
Protected Member Functions | |
_getLabelForStore () | |
Static Protected Attributes | |
static | $_labels = null |
Definition at line 34 of file Attribute.php.
_getDefaultSourceModel | ( | ) |
Get default attribute source model
Reimplemented from Mage_Eav_Model_Entity_Attribute.
Definition at line 184 of file Attribute.php.
_getLabelForStore | ( | ) | [protected] |
Get Attribute translated label for store
Definition at line 148 of file Attribute.php.
00149 { 00150 return $this->getFrontendLabel(); 00151 // self::initLabels(); 00152 // return isset(self::$_labels[$this->getData('frontend_label')]) ? self::$_labels[$this->getData('frontend_label')] : false; 00153 }
getApplyTo | ( | ) |
Retrieve apply to products array Return empty array if applied to all products
Definition at line 96 of file Attribute.php.
00097 { 00098 if ($this->getData('apply_to')) { 00099 return explode(',', $this->getData('apply_to')); 00100 } else { 00101 return array(); 00102 } 00103 }
getFrontendLabel | ( | ) |
Retrieve don't translated frontend label
Definition at line 137 of file Attribute.php.
00138 { 00139 return $this->_getData('frontend_label'); 00140 }
getSourceModel | ( | ) |
Retrieve source model
Definition at line 110 of file Attribute.php.
00111 { 00112 $model = $this->getData('source_model'); 00113 if (empty($model)) { 00114 if ($this->getBackendType() == 'int' && $this->getFrontendInput() == 'select') { 00115 return 'eav/entity_attribute_source_table'; 00116 } 00117 } 00118 return $model; 00119 }
getStoreId | ( | ) |
Retrieve store id
Definition at line 82 of file Attribute.php.
00083 { 00084 if ($dataObject = $this->getDataObject()) { 00085 return $dataObject->getStoreId(); 00086 } 00087 return $this->getData('store_id'); 00088 }
static initLabels | ( | $ | storeId = null |
) | [static] |
Initialize store Labels for attributes
int | $storeId |
Definition at line 161 of file Attribute.php.
00162 { 00163 if (is_null(self::$_labels)) { 00164 if (is_null($storeId)) { 00165 $storeId = Mage::app()->getStore()->getId(); 00166 } 00167 $attributeLabels = array(); 00168 $attributes = Mage::getResourceSingleton('catalog/product')->getAttributesByCode(); 00169 foreach ($attributes as $attribute) { 00170 if (strlen($attribute->getData('frontend_label')) > 0) { 00171 $attributeLabels[] = $attribute->getData('frontend_label'); 00172 } 00173 } 00174 00175 self::$_labels = Mage::app()->getTranslator()->getResource()->getTranslationArrayByStrings($attributeLabels, $storeId); 00176 } 00177 }
isAllowedForRuleCondition | ( | ) |
Check is allow for rule condition
Definition at line 126 of file Attribute.php.
00127 { 00128 $allowedInputTypes = array('text', 'multiselect', 'textarea', 'date', 'datetime', 'select', 'boolean', 'price'); 00129 return $this->getIsVisible() && in_array($this->getFrontendInput(), $allowedInputTypes); 00130 }
isScopeGlobal | ( | ) |
Retrieve attribute is global scope flag
Definition at line 52 of file Attribute.php.
00053 { 00054 return $this->getIsGlobal() == self::SCOPE_GLOBAL; 00055 }
isScopeStore | ( | ) |
Retrieve attribute is store scope flag
Definition at line 72 of file Attribute.php.
00073 { 00074 return !$this->isScopeGlobal() && !$this->isScopeWebsite(); 00075 }
isScopeWebsite | ( | ) |
Retrieve attribute is website scope website
Definition at line 62 of file Attribute.php.
00063 { 00064 return $this->getIsGlobal() == self::SCOPE_WEBSITE; 00065 }
$_labels = null [static, protected] |
Definition at line 45 of file Attribute.php.
const SCOPE_GLOBAL = 1 |
Definition at line 37 of file Attribute.php.
const SCOPE_STORE = 0 |
Definition at line 36 of file Attribute.php.
const SCOPE_WEBSITE = 2 |
Definition at line 38 of file Attribute.php.