Mage_Eav_Model_Entity_Attribute_Source_Config Class Reference

Inheritance diagram for Mage_Eav_Model_Entity_Attribute_Source_Config:

Mage_Eav_Model_Entity_Attribute_Source_Abstract Mage_Eav_Model_Entity_Attribute_Source_Interface Mage_Catalog_Model_Entity_Product_Attribute_Design_Options_Container

List of all members.

Public Member Functions

 getAllOptions ()

Protected Attributes

 $_configNodePath


Detailed Description

Definition at line 37 of file Config.php.


Member Function Documentation

getAllOptions (  ) 

Retrieve all options for the source from configuration

Returns:
array

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     }


Member Data Documentation

$_configNodePath [protected]


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:10 2009 for Magento by  doxygen 1.5.8