_options)) { $this->_options = Mage::getResourceModel('tax/class_collection') ->addFieldToFilter('class_type', Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT) ->load() ->toOptionArray(); } $options = $this->_options; array_unshift($options, array('value'=>'0', 'label'=>Mage::helper('tax')->__('None'))); if ($withEmpty) { array_unshift($options, array('value'=>'', 'label'=>Mage::helper('tax')->__('-- Please Select --'))); } return $options; } /** * Get a text for option value * * @param string|integer $value * @return string */ public function getOptionText($value) { $options = $this->getAllOptions(false); foreach ($options as $item) { if ($item['value'] == $value) { return $item['label']; } } return false; } /** * Convert to options array * * @return array */ public function toOptionArray() { return $this->getAllOptions(); } /** * Retrieve flat column definition * * @return array */ public function getFlatColums() { $attributeCode = $this->getAttribute()->getAttributeCode(); $column = array( 'unsigned' => true, 'default' => null, 'extra' => null ); if (Mage::helper('core')->useDbCompatibleMode()) { $column['type'] = 'int'; $column['is_null'] = true; } else { $column['type'] = Varien_Db_Ddl_Table::TYPE_INTEGER; $column['nullable'] = true; $column['comment'] = $attributeCode . ' tax column'; } return array($attributeCode => $column); } /** * Retrieve Select for update attribute value in flat table * * @param int $store * @return Varien_Db_Select|null */ public function getFlatUpdateSelect($store) { return Mage::getResourceModel('eav/entity_attribute_option') ->getFlatUpdateSelect($this->getAttribute(), $store, false); } }