/** * Create a new iterator over a tree node's children * * @param TreeNode $node */ public function __construct(TreeNode $node) { $this->children = new ArrayIterator($node->getChildren()); }