_options)) { $this->_options = array( array( 'label' => Mage::helper('eav')->__('Yes'), 'value' => 1 ), array( 'label' => Mage::helper('eav')->__('No'), 'value' => 0 ), ); } return $this->_options; } /** * Retrieve option array * * @return array */ public function getOptionArray() { $_options = array(); foreach ($this->getAllOptions() as $option) { $_options[$option['value']] = $option['label']; } return $_options; } /** * Get a text for option value * * @param string|integer $value * @return string */ public function getOptionText($value) { $options = $this->getAllOptions(); foreach ($options as $option) { if ($option['value'] == $value) { return $option['label']; } } return false; } /** * Retrieve flat column definition * * @return array */ public function getFlatColums() { $attributeCode = $this->getAttribute()->getAttributeCode(); $column = array( 'unsigned' => false, 'default' => null, 'extra' => null ); if (Mage::helper('core')->useDbCompatibleMode()) { $column['type'] = 'tinyint(1)'; $column['is_null'] = true; } else { $column['type'] = Varien_Db_Ddl_Table::TYPE_SMALLINT; $column['length'] = 1; $column['nullable'] = true; $column['comment'] = $attributeCode . ' column'; } return array($attributeCode => $column); } /** * Retrieve Indexes(s) for Flat * * @return array */ public function getFlatIndexes() { $indexes = array(); $index = 'IDX_' . strtoupper($this->getAttribute()->getAttributeCode()); $indexes[$index] = array( 'type' => 'index', 'fields' => array($this->getAttribute()->getAttributeCode()) ); return $indexes; } /** * Retrieve Select For Flat Attribute update * * @param int $store * @return Varien_Db_Select|null */ public function getFlatUpdateSelect($store) { return Mage::getResourceModel('eav/entity_attribute') ->getFlatUpdateSelect($this->getAttribute(), $store); } }