Public Member Functions | |
getAllOptions ($withEmpty=false) | |
getOptionText ($value) | |
toOptionArray () | |
getFlatColums () | |
getFlatUpdateSelect ($store) |
Definition at line 28 of file Product.php.
getAllOptions | ( | $ | withEmpty = false |
) |
Definition at line 30 of file Product.php.
00031 { 00032 if (is_null($this->_options)) { 00033 $this->_options = Mage::getResourceModel('tax/class_collection') 00034 ->addFieldToFilter('class_type', 'PRODUCT') 00035 ->load() 00036 ->toOptionArray(); 00037 } 00038 00039 $options = $this->_options; 00040 array_unshift($options, array('value'=>'0', 'label'=>Mage::helper('tax')->__('None'))); 00041 if ($withEmpty) { 00042 array_unshift($options, array('value'=>'', 'label'=>Mage::helper('tax')->__('-- Please Select --'))); 00043 } 00044 return $options; 00045 }
getFlatColums | ( | ) |
Get Column(s) names for flat data building
Reimplemented from Mage_Eav_Model_Entity_Attribute_Source_Abstract.
Definition at line 75 of file Product.php.
00076 { 00077 $columns = array(); 00078 $columns[$this->getAttribute()->getAttributeCode()] = array( 00079 'type' => 'int', 00080 'unsigned' => false, 00081 'is_null' => true, 00082 'default' => null, 00083 'extra' => null 00084 ); 00085 return $columns; 00086 }
getFlatUpdateSelect | ( | $ | store | ) |
Retrieve Select for update Attribute value in flat table
int | $store |
Reimplemented from Mage_Eav_Model_Entity_Attribute_Source_Abstract.
Definition at line 94 of file Product.php.
00095 { 00096 return Mage::getResourceModel('eav/entity_attribute_option') 00097 ->getFlatUpdateSelect($this->getAttribute(), $store, false); 00098 }
getOptionText | ( | $ | value | ) |
Get a text for option value
string|integer | $value |
Reimplemented from Mage_Eav_Model_Entity_Attribute_Source_Abstract.
Definition at line 53 of file Product.php.
00054 { 00055 $options = $this->getAllOptions(false); 00056 00057 foreach ($options as $item) { 00058 if ($item['value'] == $value) { 00059 return $item['label']; 00060 } 00061 } 00062 return false; 00063 }
toOptionArray | ( | ) |