Factory Interface Reference

Detailed Description

Interface for Factory implementations.

A Factory is used to instantiate services to be used by clients.

Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

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
$nameThe name of the instance (section, where the instance is defined)
$dynamicConfigurationAssociative 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
$classThe name of the class
$dynamicConfigurationAssociative 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
$nameThe name of the instance.
$instanceThe instance

Implemented in DefaultFactory.

addInterfaces ( array  $interfaces)

Add interfaces that instances must implement.

Parameters
$interfacesAssociative array with instance names as keys and interface names as values.

Implemented in DefaultFactory.

clear ( )

Delete all created instances.

Implemented in DefaultFactory.