Factory Interface Reference
Detailed Description
Interface for Factory implementations.
A Factory is used to instantiate services to be used by clients.
Definition at line 19 of file Factory.php.
Inheritance diagram for Factory:Public Member Functions | |
| getInstance ($name, $dynamicConfiguration=array()) | |
| getClassInstance ($class, $dynamicConfiguration=array()) | |
| registerInstance ($name, $instance) | |
| addInterfaces (array $interfaces) | |
| clear () | |
Member Function Documentation
| getInstance | ( | $name, | |
$dynamicConfiguration = array() |
|||
| ) |
Get an instance from the configuration.
- Note
- Instance names are treated case insensitive
- Parameters
-
$name The name of the instance (section, where the instance is defined) $dynamicConfiguration Associative array with key value pairs for dynamic instance properties (optional)
- Returns
- Object
Implemented in DefaultFactory.
| getClassInstance | ( | $class, | |
$dynamicConfiguration = array() |
|||
| ) |
Create an instance of a class.
Instances created with this method are not shared.
- Parameters
-
$class The name of the class $dynamicConfiguration Associative array with key value pairs for dynamic instance properties (optional)
- Returns
- Object
Implemented in DefaultFactory.
| registerInstance | ( | $name, | |
| $instance | |||
| ) |
Register a shared instance with a given name.
- Note
- Instance names are treated case insensitive
- Parameters
-
$name The name of the instance. $instance The instance
Implemented in DefaultFactory.
| addInterfaces | ( | array | $interfaces | ) |
Add interfaces that instances must implement.
- Parameters
-
$interfaces Associative array with instance names as keys and interface names as values.
Implemented in DefaultFactory.
| clear | ( | ) |
Delete all created instances.
Implemented in DefaultFactory.