\AKAbstractObject
The base class of Akeeba Engine objects. Allows for error and warnings logging and propagation. Largely based on the Joomla! 1.5 JObject class.
Synopsis
class AKAbstractObject
{
- // members
- private $_errors;
- protected $_errors_queue_size;
- private $_warnings;
- protected $_warnings_queue_size;
- // methods
- 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()
- private mixed getItemFromArray()
Hierarchy
Extended by
Members
private
- $_errors — array
- $_warnings — array
protected
- $_errors_queue_size — array
- $_warnings_queue_size — array
Methods
private
- getItemFromArray() — Returns the last item of a LIFO string message queue, or a specific item if so specified.
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
- __construct() — Public constructor, makes sure we are instanciated only by the factory class
- 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