Public Member Functions | |
setAttribute ($attribute) | |
getAttribute () | |
getInputType () | |
getLabel () | |
getValue (Varien_Object $object) | |
isVisible () | |
getClass () | |
getConfigField ($fieldName) | |
getSelectOptions () | |
getOption ($optionId) | |
getInputRendererClass () | |
Protected Attributes | |
$_attribute |
Definition at line 35 of file Abstract.php.
getAttribute | ( | ) |
getClass | ( | ) |
Definition at line 122 of file Abstract.php.
00123 { 00124 $out = $this->getAttribute()->getFrontendClass(); 00125 if ($this->getAttribute()->getIsRequired()) { 00126 $out .= ' required-entry'; 00127 } 00128 return $out; 00129 }
getConfigField | ( | $ | fieldName | ) |
Definition at line 131 of file Abstract.php.
00132 { 00133 return $this->getAttribute()->getData('frontend_'.$fieldName); 00134 }
getInputRendererClass | ( | ) |
Retrieve Input Renderer Class
Definition at line 159 of file Abstract.php.
00159 { 00160 if ($className = $this->getAttribute()->getData('frontend_input_renderer')) { 00161 return Mage::getConfig()->getBlockClassName($className); 00162 } 00163 return null; 00164 }
getInputType | ( | ) |
Get attribute type for user interface form
Definition at line 72 of file Abstract.php.
00073 { 00074 return $this->getAttribute()->getFrontendInput(); 00075 }
getLabel | ( | ) |
Enter description here...
Definition at line 82 of file Abstract.php.
00083 { 00084 $label = $this->getAttribute()->getFrontendLabel(); 00085 if (is_null($label) || $label=='') { 00086 $label = $this->getAttribute()->getAttributeCode(); 00087 } 00088 return $label; 00089 }
getOption | ( | $ | optionId | ) |
Definition at line 146 of file Abstract.php.
00147 { 00148 if ($source = $this->getAttribute()->getSource()) { 00149 return $source->getOptionText($optionId); 00150 } 00151 return false; 00152 }
getSelectOptions | ( | ) |
Get select options in case it's select box and options source is defined
Definition at line 141 of file Abstract.php.
00142 { 00143 return $this->getAttribute()->getSource()->getAllOptions(); 00144 }
getValue | ( | Varien_Object $ | object | ) |
Reimplemented in Mage_Eav_Model_Entity_Attribute_Frontend_Datetime.
Definition at line 91 of file Abstract.php.
00092 { 00093 $value = $object->getData($this->getAttribute()->getAttributeCode()); 00094 if (in_array($this->getConfigField('input'), array('select','boolean'))) { 00095 $valueOption = $this->getOption($value); 00096 if (!$valueOption) { 00097 $opt = new Mage_Eav_Model_Entity_Attribute_Source_Boolean(); 00098 if ($options = $opt->getAllOptions()) { 00099 foreach ($options as $option) { 00100 if ($option['value'] == $value) { 00101 $valueOption = $option['label']; 00102 } 00103 } 00104 } 00105 } 00106 $value = $valueOption; 00107 } 00108 elseif ($this->getConfigField('input')=='multiselect') { 00109 $value = $this->getOption($value); 00110 if (is_array($value)) { 00111 $value = implode(', ', $value); 00112 } 00113 } 00114 return $value; 00115 }
isVisible | ( | ) |
Definition at line 117 of file Abstract.php.
00118 { 00119 return $this->getConfigField('frontend_visible'); 00120 }
setAttribute | ( | $ | attribute | ) |
Set attribute instance
Mage_Eav_Model_Entity_Attribute_Abstract | $attribute |
Definition at line 51 of file Abstract.php.
00052 { 00053 $this->_attribute = $attribute; 00054 return $this; 00055 }
$_attribute [protected] |
Definition at line 43 of file Abstract.php.