CSActiveScriptStepList
in package
implements
Iterator
API Object that collects CSActiveScriptSteps
Tags
Interfaces, Classes and Traits
- Iterator
Table of Contents
- __construct() : mixed
- Creates a new step list for a job
- addStep() : void
- Adds one step to the end of the list
- current() : CSActiveScriptStep
- Returns the current step, required by the Iterator Interface.
- flushAddedSteps() : void
- Will be called at the end of adding steps and every 1000 steps
- getCurrentStep() : CSActiveScriptStep
- Gets the current step object
- getCurrentStepPosition() : string
- Tells which step was reached most recently
- getIterator() : array<string|int, CSActiveScriptStep>
- Returns an Iterator that can be traversed with foreach.
- getProgress() : float
- Tells how many percent of the intended steps have been executed
- getProgressMax() : int
- getProgressValue() : int
- getStep() : CSActiveScriptStep
- Returns the step for a given StepID
- getStepByPosition() : CSActiveScriptStep
- Returns the step for a given step position
- getStepCount() : int
- Tells how many steps this job has
- getStepPosition() : int
- Gets the position of a step within the step list
- insertStep() : mixed
- Inserts step into the step list
- key() : int
- Returns the current step position, required by the Iterator interface.
- next() : void
- Sets the current step position to the next step, required by the Iterator interface.
- rewind() : mixed
- Can be called to reset the internal step counter, required by the Iterator interface.
- setCurrentStepPosition() : mixed
- Defines which step was reached most recently
- valid() : bool
- Tells if the current step position is a valid one, required by the Iterator interface.
Methods
__construct()
Creates a new step list for a job
public
__construct(CSActiveScriptJob $oJob) : mixed
Parameters
- $oJob : CSActiveScriptJob
Tags
Return values
mixed —addStep()
Adds one step to the end of the list
public
addStep(mixed $sStepID[, mixed $data = array() ][, mixed $bDelayed = true ]) : void
Parameters
- $sStepID : mixed
- $data : mixed = array()
- $bDelayed : mixed = true
Tags
Return values
void —current()
Returns the current step, required by the Iterator Interface.
public
current() : CSActiveScriptStep
Note: Return type will change to mixed.
Tags
Return values
CSActiveScriptStep —flushAddedSteps()
Will be called at the end of adding steps and every 1000 steps
public
final flushAddedSteps() : void
As the steps are added delayed at the end of adding steps some steps could not yet have been saved yet. This method flushes the buffer to the database. It is called by the active job framework automatically after all steps have been added and every 1000 steps.
Tags
Return values
void —getCurrentStep()
Gets the current step object
public
getCurrentStep() : CSActiveScriptStep
Tags
Return values
CSActiveScriptStep —getCurrentStepPosition()
Tells which step was reached most recently
public
getCurrentStepPosition() : string
Tags
Return values
string —the latest step id
getIterator()
Returns an Iterator that can be traversed with foreach.
public
getIterator() : array<string|int, CSActiveScriptStep>
Actually the CSActiveScriptStepList object implements the Iterator Interface so that you can directly use it in foreach statements also.
Tags
Return values
array<string|int, CSActiveScriptStep> —the iterator through the steps
getProgress()
Tells how many percent of the intended steps have been executed
public
getProgress() : float
Tags
Return values
float —a number between 0 and 1
getProgressMax()
public
getProgressMax() : int
Tags
Return values
int —the maximal step position within a progress model
getProgressValue()
public
getProgressValue() : int
Tags
Return values
int —the current step position within a progress model
getStep()
Returns the step for a given StepID
public
getStep(string $sStepID) : CSActiveScriptStep
Parameters
- $sStepID : string
-
the ID of the step
Tags
Return values
CSActiveScriptStep —getStepByPosition()
Returns the step for a given step position
public
getStepByPosition(int $iPosition) : CSActiveScriptStep
Parameters
- $iPosition : int
-
the position
Tags
Return values
CSActiveScriptStep —getStepCount()
Tells how many steps this job has
public
getStepCount() : int
Tags
Return values
int —getStepPosition()
Gets the position of a step within the step list
public
getStepPosition(string $sStepID) : int
Parameters
- $sStepID : string
-
the id of the step
Tags
Return values
int —the position within the list, false if not found
insertStep()
Inserts step into the step list
public
insertStep(CSActiveScriptStep $sNewStepID[, string $sAfterStepID = null ][, array<string|int, string> $aData = array() ]) : mixed
Parameters
- $sNewStepID : CSActiveScriptStep
- $sAfterStepID : string = null
-
the step will be inserted after this step, if null after the current step id
- $aData : array<string|int, string> = array()
-
any associative data array that should be stored with this step
Tags
Return values
mixed —key()
Returns the current step position, required by the Iterator interface.
public
key() : int
Note: Return type will change to mixed.
Tags
Return values
int —the current step position
next()
Sets the current step position to the next step, required by the Iterator interface.
public
next() : void
Note: Return type will change to void.
Tags
Return values
void —rewind()
Can be called to reset the internal step counter, required by the Iterator interface.
public
rewind() : mixed
Note: Return type will change to void.
return @void
Tags
Return values
mixed —setCurrentStepPosition()
Defines which step was reached most recently
public
setCurrentStepPosition(mixed $iStepPosition) : mixed
Parameters
- $iStepPosition : mixed
Tags
Return values
mixed —valid()
Tells if the current step position is a valid one, required by the Iterator interface.
public
valid() : bool
Note: Return type will change to bool.
Tags
Return values
bool —true if the current step position is valid
