Public Member Functions | |
getAllOptions () | |
getOptionText ($value) |
Definition at line 34 of file Store.php.
getAllOptions | ( | ) |
Retrieve All options
Implements Mage_Eav_Model_Entity_Attribute_Source_Interface.
Definition at line 36 of file Store.php.
00037 { 00038 if (!$this->_options) { 00039 $collection = Mage::getResourceModel('core/store_collection'); 00040 if ('store_id' == $this->getAttribute()->getAttributeCode()) { 00041 $collection->setWithoutDefaultFilter(); 00042 } 00043 $this->_options = Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(); 00044 if ('created_in' == $this->getAttribute()->getAttributeCode()) { 00045 array_unshift($this->_options, array('value' => '0', 'label' => Mage::helper('customer')->__('Admin'))); 00046 } 00047 } 00048 return $this->_options; 00049 }
getOptionText | ( | $ | value | ) |
Get a text for option value
string|integer | $value |
Reimplemented from Mage_Eav_Model_Entity_Attribute_Source_Table.
Definition at line 51 of file Store.php.
00052 { 00053 if(!$value)$value ='0'; 00054 $isMultiple = false; 00055 if (strpos($value, ',')) { 00056 $isMultiple = true; 00057 $value = explode(',', $value); 00058 } 00059 00060 if (!$this->_options) { 00061 $collection = Mage::getResourceModel('core/store_collection'); 00062 if ('store_id' == $this->getAttribute()->getAttributeCode()) { 00063 $collection->setWithoutDefaultFilter(); 00064 } 00065 $this->_options = $collection->load()->toOptionArray(); 00066 if ('created_in' == $this->getAttribute()->getAttributeCode()) { 00067 array_unshift($this->_options, array('value' => '0', 'label' => Mage::helper('customer')->__('Admin'))); 00068 } 00069 } 00070 00071 if ($isMultiple) { 00072 $values = array(); 00073 foreach ($value as $val) { 00074 $values[] = $this->_options[$val]; 00075 } 00076 return $values; 00077 } 00078 else { 00079 return $this->_options[$value]; 00080 } 00081 return false; 00082 }