Public Member Functions | |
getAllOptions () | |
Protected Attributes | |
$_configNodePath |
Definition at line 37 of file Config.php.
getAllOptions | ( | ) |
Retrieve all options for the source from configuration
Implements Mage_Eav_Model_Entity_Attribute_Source_Interface.
Definition at line 46 of file Config.php.
00047 { 00048 if (is_null($this->_options)) { 00049 $this->_options = array(); 00050 if ($this->_configNodePath) { 00051 $rootNode = Mage::getConfig()->getNode($this->_configNodePath); 00052 } 00053 if (!$rootNode) { 00054 throw Mage::exception('Mage_Eav', Mage::helper('eav')->__('Failed to load node %s from config.', $this->_configNodePath)); 00055 } 00056 $options = $rootNode->children(); 00057 if (empty($options)) { 00058 throw Mage::exception('Mage_Eav', Mage::helper('eav')->__('No options found in config node %s', $this->_configNodePath)); 00059 } 00060 foreach ($options as $option) { 00061 $this->_options[] = array( 00062 'value' => (string)$option->value, 00063 'label' => (string)$option->label 00064 ); 00065 } 00066 } 00067 00068 return $this->_options; 00069 }
$_configNodePath [protected] |
Reimplemented in Mage_Catalog_Model_Entity_Product_Attribute_Design_Options_Container.
Definition at line 39 of file Config.php.