First steps
10/16/2009
With this document, you can learn the basics of using BrickOO in your applications.
BrickOO comes with an object manager.
You can use it for acquiring objects and singleton instances of each component, service or object-helper.
Acquiring objects is very easy. Just use the GetObject method of the core class.
Example:
On each call of the GetObject method, you get a new object.
If you want to work with a single instance of a BrickOO component, just use the GetSingleton method of the core class.
Example:
So, you get the same object on each time you call this method with the identifier of the adequate component.
Decorating while runtime is a basic feature of BrickOO.
The following lines of this section will show you "how to do".
The following example shows how to decorate an already instanced object.
See more in: Manual/BrickOO
Objects
BrickOO comes with an object manager.
You can use it for acquiring objects and singleton instances of each component, service or object-helper.
Acquiring objects
Acquiring objects is very easy. Just use the GetObject method of the core class.
Example:
<?php
$cal = BRICKOO::GetObject ('Calendar');
?>
On each call of the GetObject method, you get a new object.
Acquiring singleton instances
If you want to work with a single instance of a BrickOO component, just use the GetSingleton method of the core class.
Example:
<?php
$cal = BRICKOO::GetSingleton ('Calendar');
?>
So, you get the same object on each time you call this method with the identifier of the adequate component.
Decorating
Decorating while runtime is a basic feature of BrickOO.
The following lines of this section will show you "how to do".
Add a decorator
The following example shows how to decorate an already instanced object.
<?php
BRICKOO::AddDecorator($object, 'myDecorator', array('name', 30), BRICKOO::DECORATOR_SINGLE);
?>
See more in: Manual/BrickOO