54 $this->processedOidList = [];
55 $this->currentNode = $node;
56 $this->startNode = $node;
72 public function key() {
73 return $this->currentNode->getOID()->__toString();
81 $this->processedOidList[] = $this->currentNode->getOID()->__toString();
85 $mapper = $this->currentNode->getMapper();
86 $relations = $mapper->getRelations(
'child');
88 foreach ($relations as $relation) {
89 $aggregationKind = $relation->getOtherAggregationKind();
90 if ($relation->getOtherNavigability() && ($followAll || in_array($aggregationKind, $this->aggregationKinds))) {
91 $childValue = $this->currentNode->getValue($relation->getOtherRole());
92 if ($childValue !=
null) {
93 $children = $relation->isMultiValued() ? $childValue : [$childValue];
94 foreach ($children as $child) {
95 $childrenArray[] = $child;
103 if (
sizeof($this->nodeList) != 0) {
104 $node = array_pop($this->nodeList);
105 $oidStr = $node->getOID()->__toString();
107 while (
sizeof($this->nodeList) > 0 && in_array($oidStr, $this->processedOidList)) {
108 $node = array_pop($this->nodeList);
109 $oidStr = $node->getOID()->__toString();
112 if (
sizeof($this->nodeList) == 0 && in_array($oidStr, $this->processedOidList)) {
115 $this->currentNode = $node;
128 $this->nodeList = [];
129 $this->processedOidList = [];
145 for ($i=
sizeof(
$nodeList)-1; $i>=0; $i--) {
valid()
Checks if current position is valid.
key()
Return the key of the current element.
NodeIterator is used to iterate over a tree/list built of Nodes using a Depth-First-Algorithm.
current()
Return the current element.
addToQueue($nodeList)
Add nodes to the processing queue.
rewind()
Rewind the Iterator to the first element.
Node adds the concept of relations to PersistentObject.
Node related interfaces and classes.
next()
Move forward to next element.
__construct($node, $aggregationKinds=[])
Constructor.