- Direct superclass:\patterns\Singleton
- Direct known subclasses:
The 'base' object is a global system-wide singleton, used generally to store database connectors, configurations, user connection and security and so.
The 'base' object is set both as a static property and a local attribute in every object extended from \core\WAObject.
This means you can access the base object in every method just with a:
$this->base->[attribute]; or $this->base->[method]();
By its nature of a singleton, you can only create ONE class and instance of \core\WABase, system-wide.
The \core\WABase class insert itself automatically as the base object of \core\WAObject.
class myBase extends \core\WABase
$this->config = $config;
// creating an instance of myBase (extending \core\WABase) it will install automatically into static global base of \core\WAObject)
new myBase(array('config' => 'my config parameters'));
... Lots of your code ...
class myClass extends \core\WAClass
// get the system-wide configuration
$config = $this->base->config;
Creates the unique instance and insert it into the WAObject static base
There is no constant into this class.
There is no attribute into this class.
There is no method into this class.