The WebAbility® Network Developers - Documentation
WebAbility Site
\core\WAObject reference

I. Structure:


- namespace:
\core\

- Direct superclass:
\core\WADebug

- Direct known subclasses:
\core\WAClass
\datasource\DataSource
\patterns\Singleton
\patterns\Multiton
\patterns\Factory
\patterns\Dispatcher

II. Description:


This is the class to create a unified application object with specific properties.
First of all, the class have a protection so the programmer cannot set new class attributes without having them previously created as public, protected or private. This is a good protection against bad scope variables and wrong named variables. It works like Java or C++ and does not permit to use "unknown" variables in the scope of the instance ($this->xxx).

Then, the WAObject permits to define a global singleton and assign it to any object extended directly or indirectly from WAObject.
WAObject is then perfect to be the basic framework object to extend. It will always contains the global object ready to use.
Note that the $base and $ibase protected attributes can be mixed and can keep a singleton or anything else, like a simple value or an array of other variables for example.

You should extend all your classes directly or indirectly from WAObject.

III. Reference:


3.1. Contructor:


\core\WAObject()
Creates the instance. It will make a reference of the static global singleton object to a local attribute.

3.2. Constants:

There is no constant into this class.


3.3. Attributes:


protected static mixed $ibase
Is used to store the basic application singleton or anything else you need.

protected mixed $base
Is used to store the basic application singleton or anything else you need. This is a only a reference to the static $ibase attribute.


3.4. Methods:


public void static setBase($base)
This method is used to fix the global application singleton in the class.
  • $base: mixed, the global application singleton.