PersistentIterator is used to iterate over a tree/list built of persistent objects using a Depth-First-Algorithm.
To persist its state use the PersistentIterator::save() method, to restore its state use the static PersistentIterator::load() method, which returns the loaded instance.
- Author
- ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m
Definition at line 24 of file PersistentIterator.php.
|
static | reset ($id, Session $session) |
|
static | load ($id, $persistenceFacade, $session) |
|
◆ __construct()
Constructor.
- Parameters
-
$id | The unique iterator id used to store iterator's the state in the session |
$persistenceFacade | |
$session | |
$oid | The object id 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 47 of file PersistentIterator.php.
◆ save()
◆ reset()
static reset |
( |
|
$id, |
|
|
Session |
$session |
|
) |
| |
|
static |
Reset the iterator with the given id.
- Parameters
-
$id | The iterator id |
$session | |
Definition at line 79 of file PersistentIterator.php.
◆ load()
static load |
( |
|
$id, |
|
|
|
$persistenceFacade, |
|
|
|
$session |
|
) |
| |
|
static |
Load an iterator state from the session.
- Parameters
-
$id | The unique iterator id used to store iterator's the state in the session |
$persistenceFacade | |
$session | |
- Returns
- PersistentIterator instance holding the saved state or null if unique id is not found
Definition at line 90 of file PersistentIterator.php.
◆ current()
◆ key()
Return the key of the current element.
- Returns
- Number, the current depth
Definition at line 119 of file PersistentIterator.php.
◆ next()
◆ rewind()
◆ valid()
◆ addToQueue()
addToQueue |
( |
|
$oidList, |
|
|
|
$depth |
|
) |
| |
|
protected |
Add object ids to the processing queue.
- Parameters
-
$oidList | An array of object ids. |
$depth | The depth of the object ids in the tree. |
Definition at line 196 of file PersistentIterator.php.
◆ $end
◆ $oidList
◆ $processedOidList
◆ $currentOid
◆ $startOid
◆ $currentDepth
◆ $aggregationKinds