Varien_Data_Tree_Node_Collection Class Reference

List of all members.

Public Member Functions

 __construct ($container)
 getNodes ()
 getIterator ()
 offsetSet ($key, $value)
 offsetGet ($key)
 offsetUnset ($key)
 offsetExists ($key)
 add (Varien_Data_Tree_Node $node)
 delete ($node)
 count ()
 lastNode ()
 searchById ($nodeId)


Detailed Description

Definition at line 34 of file Collection.php.


Constructor & Destructor Documentation

__construct ( container  ) 

Definition at line 39 of file Collection.php.

00040     {
00041         $this->_nodes = array();
00042         $this->_container = $container;
00043     }


Member Function Documentation

add ( Varien_Data_Tree_Node node  ) 

Adds a node to this node

Definition at line 93 of file Collection.php.

00094     {
00095         $node->setParent($this->_container);
00096 
00097         // Set the Tree for the node
00098         if ($this->_container->getTree() instanceof Varien_Data_Tree) {
00099             $node->setTree($this->_container->getTree());
00100         }
00101 
00102         $this->_nodes[$node->getId()] = $node;
00103 
00104         return $node;
00105     }

count (  ) 

Definition at line 115 of file Collection.php.

00116     {
00117         return count($this->_nodes);
00118     }

delete ( node  ) 

Definition at line 107 of file Collection.php.

00108     {
00109         if (isset($this->_nodes[$node->getId()])) {
00110             unset($this->_nodes[$node->getId()]);
00111         }
00112         return $this;
00113     }

getIterator (  ) 

Implementation of IteratorAggregate.getIterator()

Definition at line 53 of file Collection.php.

00054     {
00055         return new ArrayIterator($this->_nodes);
00056     }

getNodes (  ) 

Definition at line 45 of file Collection.php.

00046     {
00047         return $this->_nodes;
00048     }

lastNode (  ) 

Definition at line 120 of file Collection.php.

00121     {
00122         return !empty($this->_nodes) ? $this->_nodes[count($this->_nodes) - 1] : null;
00123     }

offsetExists ( key  ) 

Implementation of ArrayAccess:offsetExists()

Definition at line 85 of file Collection.php.

00086     {
00087         return isset($this->_nodes[$key]);
00088     }

offsetGet ( key  ) 

Implementation of ArrayAccess:offsetGet()

Definition at line 69 of file Collection.php.

00070     {
00071         return $this->_nodes[$key];
00072     }

offsetSet ( key,
value 
)

Implementation of ArrayAccess:offsetSet()

Definition at line 61 of file Collection.php.

00062     {
00063         $this->_nodes[$key] = $value;
00064     }

offsetUnset ( key  ) 

Implementation of ArrayAccess:offsetUnset()

Definition at line 77 of file Collection.php.

00078     {
00079         unset($this->_nodes[$key]);
00080     }

searchById ( nodeId  ) 

Definition at line 125 of file Collection.php.

00126     {
00127         if (isset($this->_nodes[$nodeId])) {
00128             return $this->_nodes[$nodeId];
00129         }
00130         return null;
00131     }


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

Generated on Sat Jul 4 17:25:01 2009 for Magento by  doxygen 1.5.8