Varien_Convert_Container_Collection Class Reference

List of all members.

Public Member Functions

 setDefaultClass ($className)
 addItem ($name, Varien_Convert_Container_Interface $item)
 getItem ($name)
 hasItem ($name)

Protected Attributes

 $_items = array()
 $_defaultClass = 'Varien_Convert_Container_Generic'


Detailed Description

Definition at line 35 of file Collection.php.


Member Function Documentation

addItem ( name,
Varien_Convert_Container_Interface item 
)

Definition at line 46 of file Collection.php.

00047     {
00048         if (is_null($name)) {
00049             if ($item->getName()) {
00050                 $name = $item->getName();
00051             } else {
00052                 $name = sizeof($this->_items);
00053             }
00054         }
00055 
00056         $this->_items[$name] = $item;
00057 
00058         return $item;
00059     }

getItem ( name  ) 

Definition at line 61 of file Collection.php.

00062     {
00063         if (!isset($this->_items[$name])) {
00064             $this->addItem($name, new $this->_defaultClass());
00065         }
00066         return $this->_items[$name];
00067     }

hasItem ( name  ) 

Definition at line 69 of file Collection.php.

00070     {
00071         return isset($this->_items[$name]);
00072     }

setDefaultClass ( className  ) 

Definition at line 40 of file Collection.php.

00041     {
00042         $this->_defaultClass = $className;
00043         return $this;
00044     }


Member Data Documentation

$_defaultClass = 'Varien_Convert_Container_Generic' [protected]

Definition at line 38 of file Collection.php.

$_items = array() [protected]

Definition at line 37 of file Collection.php.


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

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