diff --git a/library/Icinga/Data/Tree/TreeNodeIterator.php b/library/Icinga/Data/Tree/TreeNodeIterator.php new file mode 100644 index 000000000..cdcefe8ea --- /dev/null +++ b/library/Icinga/Data/Tree/TreeNodeIterator.php @@ -0,0 +1,93 @@ +children = new ArrayIterator($node->getChildren()); + } + + /** + * (non-PHPDoc) + * @see \RecursiveIterator::current() For the method documentation. + */ + public function current() + { + return $this->children->current(); + } + + /** + * (non-PHPDoc) + * @see \RecursiveIterator::key() For the method documentation. + */ + public function key() + { + return $this->children->key(); + } + + /** + * (non-PHPDoc) + * @see \RecursiveIterator::next() For the method documentation. + */ + public function next() + { + $this->children->next(); + } + + /** + * (non-PHPDoc) + * @see \RecursiveIterator::rewind() For the method documentation. + */ + public function rewind() + { + $this->children->rewind(); + } + + /** + * (non-PHPDoc) + * @see \RecursiveIterator::valid() For the method documentation. + */ + public function valid() + { + return $this->children->valid(); + } + + /** + * (non-PHPDoc) + * @see \RecursiveIterator::hasChildren() For the method documentation. + */ + public function hasChildren() + { + return $this->current()->hasChildren(); + } + + /** + * (non-PHPDoc) + * @see \RecursiveIterator::getChildren() For the method documentation. + */ + public function getChildren() + { + return new static($this->current()); + } +}