57 $this->_recursive = $recursive;
59 $this->_currentAttributes = $node->getValueNames(
false);
60 $this->_currentAttribute =
current($this->_currentAttributes);
69 $node = $this->_nodeIterator->current();
70 return $node->getValue($this->_currentAttribute);
77 public function key() {
85 $next =
next($this->_currentAttributes);
86 if ($next !==
false) {
87 $this->_currentAttribute = $next;
90 if ($this->_recursive) {
91 $this->_nodeIterator->next();
92 if (!$this->_nodeIterator->valid()) {
96 $nextNode = $this->_nodeIterator->current();
97 $this->_currentAttributes = $nextNode->getValueNames(
false);
98 $this->_currentAttribute =
current($this->_currentAttributes);
112 $this->_nodeIterator->rewind();
113 $this->_currentAttributes = $this->_nodeIterator->current()->getValueNames(
false);
114 $this->_currentAttribute =
current($this->_currentAttributes);
130 return $this->_nodeIterator->current();
next()
Move forward to next element.
__construct($node, $recursive)
Constructor.
Node related interfaces and classes.
key()
Return the key of the current element.
NodeValueIterator is used to iterate over all persistent values of a Node (not including relations)...
NodeIterator is used to iterate over a tree/list built of Nodes using a Depth-First-Algorithm.
current()
Return the current element.
currentNode()
Get the current node.
rewind()
Rewind the Iterator to the first element.
valid()
Checks if current position is valid.