wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
PersistentIterator Class Reference

Public Member Functions

 PersistentIterator ($oid)
 
 save ()
 
load ($uid)
 
proceed ()
 
 getCurrentOID ()
 
 getCurrentDepth ()
 
 isEnd ()
 
 reset ($oid)
 
 addToSeenList ($oidList, $depth)
 
 dumpOIDList ()
 

Public Attributes

 $_end
 
 $_oidList
 
 $_allList
 
 $_currentOID
 
 $_currentDepth
 

Detailed Description

PersistentIterator is used to iterate over a tree/list build of oids 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. States are identified by an unique id, which is provided after saving. PersistentIterator implements the 'Iterator Pattern'.

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.PersistentIterator.php 1462 2014-02-04 23:52:27Z iherwig
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 33 of file class.PersistentIterator.php.

Member Function Documentation

PersistentIterator::PersistentIterator (   $oid)

Constructor.

Parameters
oidThe oid to start from.

Definition at line 44 of file class.PersistentIterator.php.

Referenced by load().

PersistentIterator::save ( )

Save the iterator state to the session

Returns
A unique id to provide for load, see PersistentIterator::load()

Definition at line 56 of file class.PersistentIterator.php.

References SessionData\getInstance().

+ Here is the call graph for this function:

& PersistentIterator::load (   $uid)

Load an iterator state from the session

Note
static method
Parameters
uidThe unique id returned from the save method, see PersistentIterator::save()
Returns
A reference to an PersistentIterator instance holding the saved state or null if unique id is not found

Definition at line 72 of file class.PersistentIterator.php.

References SessionData\getInstance(), and PersistentIterator().

Referenced by CopyController\copyNodes(), XMLExportController\exportNodes(), and BatchDisplayController\loadNodes().

+ Here is the call graph for this function:

& PersistentIterator::proceed ( )

Proceed to next oid.

Returns
A reference to the Iterator.

Definition at line 92 of file class.PersistentIterator.php.

References addToSeenList(), BUILDDEPTH_SINGLE, and PersistenceFacade\getInstance().

+ Here is the call graph for this function:

PersistentIterator::getCurrentOID ( )

Get the current oid.

Returns
The current oid.

Definition at line 112 of file class.PersistentIterator.php.

References $_currentOID.

PersistentIterator::getCurrentDepth ( )

Get the current depth.

Returns
The current depth.

Definition at line 120 of file class.PersistentIterator.php.

References $_currentDepth.

PersistentIterator::isEnd ( )

Find out whether iteration is finished.

Returns
'True' if iteration is finished, 'False' alternatively.

Definition at line 128 of file class.PersistentIterator.php.

References $_end.

PersistentIterator::reset (   $oid)

Reset the iterator to given oid.

Parameters
oidThe oid of the object to start from.

Definition at line 136 of file class.PersistentIterator.php.

PersistentIterator::addToSeenList (   $oidList,
  $depth 
)

Add oids to the internal processed oid list.

Attention
Internal use only.
Parameters
oidListAn array of oids.
depthThe depth of the oids in the tree.

Definition at line 150 of file class.PersistentIterator.php.

Referenced by proceed().

PersistentIterator::dumpOIDList ( )

Definition at line 162 of file class.PersistentIterator.php.

Member Data Documentation

PersistentIterator::$_end

Definition at line 35 of file class.PersistentIterator.php.

Referenced by isEnd().

PersistentIterator::$_oidList

Definition at line 36 of file class.PersistentIterator.php.

PersistentIterator::$_allList

Definition at line 37 of file class.PersistentIterator.php.

PersistentIterator::$_currentOID

Definition at line 38 of file class.PersistentIterator.php.

Referenced by getCurrentOID().

PersistentIterator::$_currentDepth

Definition at line 39 of file class.PersistentIterator.php.

Referenced by getCurrentDepth().


The documentation for this class was generated from the following file: