Index
TIP type system
Manages all the instantiable TIP objects (types). Inheriting a class from TIP_Type gives the ability to instantiate this class only when requested (usually throught a call to getInstance()). Multiple requests to getInstance() will references the same - unique - instantiated object.
Also, the PHP file declaring the new type will be included only when required, enabling a real modular environement.
Instance identifier
An array of parent classes (without TIP_PREFIX)
Check the options
Overridable static method that checks $options for missing or invalid values and eventually corrects its content.
Constructor
Initializes a TIP_Type instance.
Basically, this class set the properties values by parsing the $options array.
Overridable post construction method
Called after the construction happened. This can be overriden to do some other post costruction operation.
The TIP_Type::postConstructor() method does nothing.
Singleton method
Manages the singletons. Given a hierarchy of parent types and a string identifier, this method returns a singleton of the instantiated object. If the object is not found, it is dinamically defined and instantiated.
The singletons are stored in a static tree, called register, containing all the hierarchy of the instantiated types.
If $options is not specified, the whole register is returned.
If $options is a string, it must specify a valid type: a partial register content of this type is returned.
In the other cases, $options must be an array of options, and a singleton for the specified object is returned. In this situation, $options must have at least the following items: * $options['id']: the instance identifier
for instance, will instantiate a TIP_Content object.
Some type automatically fills $options['id'] after the checkOptions() call: check the documentation for each class for further information.
Type instantiation
Gets the singleton of a configured object. $id could be any identifier defined in $GLOBALS['cfg'].
An internal register is mantained to avoid singleton() calls with the same $id.
Return the id of a TIP instance
Get the type of a TIP instance
Returns the type of the current - instantiated - TIP object. This function simply gets the class name (in lowercase) and strips the TIP_PREFIX from the string.
The result is converted to lowecase to avoid discrepancies between different PHP versions.
Get a property of this instance
Get a global option for the current instance
Wrappers the more general TIP::getOption() function without the need to specify the type.