Detailed Description
NodeIterator is used to iterate over a tree/list built of Nodes using a Depth-First-Algorithm.
Classes used with the NodeIterator must implement the getChildren() and getOID() methods.
The following example shows the usage:
Definition at line 36 of file NodeIterator.php.
Public Member Functions | |
__construct ($node, $aggregationKinds=[]) | |
current () | |
key () | |
next () | |
rewind () | |
valid () | |
Protected Member Functions | |
addToQueue ($nodeList) | |
Protected Attributes | |
$end | |
$nodeList | |
$processedOidList | |
$currentNode | |
$startNode | |
$aggregationKinds | |
Constructor & Destructor Documentation
◆ __construct()
__construct | ( | $node, | |
$aggregationKinds = [] |
|||
) |
Constructor.
- Parameters
-
$node The node to start from. $aggregationKinds Array of aggregation kind values of relations to follow possible values: 'none', 'shared', 'composite'. Empty array means all (default: empty)
Definition at line 51 of file NodeIterator.php.
Member Function Documentation
◆ current()
current | ( | ) |
◆ key()
key | ( | ) |
Return the key of the current element.
- Returns
- String, the serialized object id
Definition at line 72 of file NodeIterator.php.
◆ next()
next | ( | ) |
Move forward to next element.
Definition at line 79 of file NodeIterator.php.
◆ rewind()
rewind | ( | ) |
Rewind the Iterator to the first element.
Definition at line 126 of file NodeIterator.php.
◆ valid()
valid | ( | ) |
Checks if current position is valid.
Definition at line 136 of file NodeIterator.php.
◆ addToQueue()
|
protected |
Add nodes to the processing queue.
- Parameters
-
$nodeList An array of nodes.
Definition at line 144 of file NodeIterator.php.
Member Data Documentation
◆ $end
|
protected |
Definition at line 38 of file NodeIterator.php.
◆ $nodeList
|
protected |
Definition at line 39 of file NodeIterator.php.
◆ $processedOidList
|
protected |
Definition at line 40 of file NodeIterator.php.
◆ $currentNode
|
protected |
Definition at line 41 of file NodeIterator.php.
◆ $startNode
|
protected |
Definition at line 42 of file NodeIterator.php.
◆ $aggregationKinds
|
protected |
Definition at line 43 of file NodeIterator.php.