\AKAbstractPart
The superclass of all Akeeba Kickstart parts. The "parts" are intelligent stateful classes which perform a single procedure and have preparation, running and finalization phases. The transition between phases is handled automatically by this superclass' tick() final public method, which should be the ONLY public API exposed to the rest of the Akeeba Engine.
Synopsis
class AKAbstractPart
extends AKAbstractObject
{
- // members
- protected $isPrepared;
- protected $isRunning;
- protected $isFinished;
- protected $hasRan;
- protected $active_domain;
- protected $active_step;
- protected $active_substep;
- protected $_parametersArray;
- protected $databaseRoot;
- private $warnings_pointer;
- protected $observers;
- // Inherited members from AKAbstractObject
- protected $_errors_queue_size;
- protected $_warnings_queue_size;
- // methods
- protected abstract void _prepare()
- protected abstract void _finalize()
- protected abstract void _run()
- protected void setBreakFlag()
- protected void setState()
- public final array tick()
- public array getStatusArray()
- public final void setup()
- public final string getState()
- protected final array _makeReturnTable()
- protected final void setDomain()
- public final void getDomain()
- protected final void setStep()
- public final void getStep()
- protected final void setSubstep()
- public final void getSubstep()
- public void attach()
- public void detach()
- protected void notify()
- // Inherited methods from AKAbstractObject
- public void __construct()
- public string getError()
- public array getErrors()
- public void setError()
- public void resetErrors()
- public string getWarning()
- public array getWarnings()
- public void setWarning()
- public void resetWarnings()
- public void propagateToObject()
- public void propagateFromObject()
- protected void setErrorsQueueSize()
- protected void setWarningsQueueSize()
Hierarchy
Extends
Extended by
Members
private
- $warnings_pointer — int
protected
- $_errors_queue_size — array
- $_parametersArray
—
array
Any configuration variables, in the form of an array. - $_warnings_queue_size — array
- $active_domain
—
string
The name of the engine part (a.k.a. Domain), used in return table generation. - $active_step
—
string
The step this engine part is in. Used verbatim in return table and should be set by the code in the _run() method. - $active_substep
—
string
A more detailed description of the step this engine part is in. Used verbatim in return table and should be set by the code in the _run() method. - $databaseRoot — string
- $hasRan
—
boolean
Indicates whether this part has finished its run cycle - $isFinished
—
boolean
Indicates whether this part has finished its finalization cycle - $isPrepared
—
boolean
Indicates whether this part has finished its initialisation cycle - $isRunning
—
boolean
Indicates whether this part has more work to do (it's in running state) - $observers — array
Methods
protected
- _finalize() — Runs the finalisation process for this part. Should set _isFinished to true.
- _makeReturnTable() — Constructs a Response Array based on the engine part's state.
- _prepare() — Runs the preparation for this part. Should set _isPrepared to true
- _run() — Runs the main functionality loop for this part. Upon calling, should set the _isRunning to true. When it finished, should set the _hasRan to true. If an error is encountered, setError should be used.
- notify() — Notifies observers each time something interesting happened to the part
- setBreakFlag() — Sets the BREAKFLAG, which instructs this engine part that the current step must break immediately, in fear of timing out.
- setDomain()
- setState() — Sets the engine part's internal state, in an easy to use manner
- setStep()
- setSubstep()
public
- attach() — Attaches an observer object
- detach() — Dettaches an observer object
- getDomain()
- getState() — Returns the state of this engine part.
- getStatusArray() — Returns a copy of the class's status array
- getStep()
- getSubstep()
- setup() — Sends any kind of setup information to the engine part. Using this, we avoid passing parameters to the constructor of the class. These parameters should be passed as an indexed array and should be taken into account during the preparation process only. This function will set the error flag if it's called after the engine part is prepared.
- tick() — The public interface to an engine part. This method takes care for calling the correct method in order to perform the initialisation - run - finalisation cycle of operation and return a proper reponse array.
Inherited from AKAbstractObject
protected
- setErrorsQueueSize() — Sets the size of the error queue (acts like a LIFO buffer)
- setWarningsQueueSize() — Sets the size of the warnings queue (acts like a LIFO buffer)
public
- getError() — Get the most recent error message
- getErrors() — Return all errors, if any
- getWarning() — Get the most recent warning message
- getWarnings() — Return all warnings, if any
- propagateFromObject() — Propagates errors and warnings from a foreign object. Each propagated list is then cleared on the foreign object, as long as it implements resetErrors() and/or resetWarnings() methods.
- propagateToObject() — Propagates errors and warnings to a foreign object. The foreign object SHOULD implement the setError() and/or setWarning() methods but DOESN'T HAVE TO be of AKAbstractObject type. For example, this can even be used to propagate to a JObject instance in Joomla!. Propagated items will be removed from ourself.
- resetErrors() — Resets all error messages
- resetWarnings() — Resets all warning messages
- setError() — Add an error message
- setWarning() — Add an error message