Public Member Functions | |
getAllOptions () | |
getOptionArray () | |
getOptionText ($value) | |
getFlatColums () | |
getFlatIndexes () | |
getFlatUpdateSelect ($store) |
Definition at line 28 of file Boolean.php.
getAllOptions | ( | ) |
Retrieve all options array
Implements Mage_Eav_Model_Entity_Attribute_Source_Interface.
Reimplemented in Mage_GiftMessage_Model_Entity_Attribute_Source_Boolean_Config.
Definition at line 35 of file Boolean.php.
00036 { 00037 if (is_null($this->_options)) { 00038 $this->_options = array( 00039 array( 00040 'label' => Mage::helper('eav')->__('Yes'), 00041 'value' => 1 00042 ), 00043 array( 00044 'label' => Mage::helper('eav')->__('No'), 00045 'value' => 0 00046 ), 00047 ); 00048 } 00049 return $this->_options; 00050 }
getFlatColums | ( | ) |
Retrieve Column(s) for Flat
Reimplemented from Mage_Eav_Model_Entity_Attribute_Source_Abstract.
Definition at line 88 of file Boolean.php.
00089 { 00090 $columns = array(); 00091 $columns[$this->getAttribute()->getAttributeCode()] = array( 00092 'type' => 'tinyint(1)', 00093 'unsigned' => false, 00094 'is_null' => true, 00095 'default' => null, 00096 'extra' => null 00097 ); 00098 00099 return $columns; 00100 }
getFlatIndexes | ( | ) |
Retrieve Indexes(s) for Flat
Reimplemented from Mage_Eav_Model_Entity_Attribute_Source_Abstract.
Definition at line 107 of file Boolean.php.
00108 { 00109 $indexes = array(); 00110 00111 $index = 'IDX_' . strtoupper($this->getAttribute()->getAttributeCode()); 00112 $indexes[$index] = array( 00113 'type' => 'index', 00114 'fields' => array($this->getAttribute()->getAttributeCode()) 00115 ); 00116 00117 return $indexes; 00118 }
getFlatUpdateSelect | ( | $ | store | ) |
Retrieve Select For Flat Attribute update
int | $store |
Reimplemented from Mage_Eav_Model_Entity_Attribute_Source_Abstract.
Definition at line 126 of file Boolean.php.
00127 { 00128 return Mage::getResourceModel('eav/entity_attribute') 00129 ->getFlatUpdateSelect($this->getAttribute(), $store); 00130 }
getOptionArray | ( | ) |
Retrieve option array
Definition at line 57 of file Boolean.php.
00058 { 00059 $_options = array(); 00060 foreach ($this->getAllOptions() as $option) { 00061 $_options[$option['value']] = $option['label']; 00062 } 00063 return $_options; 00064 }
getOptionText | ( | $ | value | ) |
Get a text for option value
string|integer | $value |
Reimplemented from Mage_Eav_Model_Entity_Attribute_Source_Abstract.
Definition at line 72 of file Boolean.php.
00073 { 00074 $options = $this->getAllOptions(); 00075 foreach ($options as $option) { 00076 if ($option['value'] == $value) { 00077 return $option['label']; 00078 } 00079 } 00080 return false; 00081 }