21 class Collection implements \ArrayAccess, \IteratorAggregate, \Countable
39 $this->_container = $container;
59 return new \ArrayIterator($this->_nodes);
71 $this->_nodes[$key] =
$value;
81 return $this->_nodes[$key];
91 unset($this->_nodes[$key]);
101 return isset($this->_nodes[$key]);
114 if ($this->_container->getTree() instanceof
Tree) {
115 $node->
setTree($this->_container->getTree());
118 $this->_nodes[$node->
getId()] = $node;
129 public function delete($node)
131 if (isset($this->_nodes[$node->getId()])) {
132 unset($this->_nodes[$node->getId()]);
144 return count($this->_nodes);
154 if (!empty($this->_nodes)) {
156 reset($this->_nodes);
172 if (isset($this->_nodes[$nodeId])) {
173 return $this->_nodes[$nodeId];