ILIAS
release_5-2 Revision v5.2.25-18-g3f80b828510
|
Public Member Functions | |
__construct (array $values=array()) | |
Instantiate the container. More... | |
offsetSet ($id, $value) | |
Sets a parameter or an object. More... | |
offsetGet ($id) | |
Gets a parameter or an object. More... | |
offsetExists ($id) | |
Checks if a parameter or an object is set. More... | |
offsetUnset ($id) | |
Unsets a parameter or an object. More... | |
factory ($callable) | |
Marks a callable as being a factory service. More... | |
protect ($callable) | |
Protects a callable from being interpreted as a service. More... | |
raw ($id) | |
Gets a parameter or the closure defining an object. More... | |
extend ($id, $callable) | |
Extends an object definition. More... | |
keys () | |
Returns all defined value names. More... | |
register (ServiceProviderInterface $provider, array $values=array()) | |
Registers a service provider. More... | |
Private Attributes | |
$values = array() | |
$factories | |
$protected | |
$frozen = array() | |
$raw = array() | |
$keys = array() | |
Container main class.
Definition at line 34 of file Container.php.
Instantiate the container.
Objects and parameters can be passed as argument to the constructor.
array | $values | The parameters or objects. |
Definition at line 50 of file Container.php.
Pimple\Container::extend | ( | $id, | |
$callable | |||
) |
Extends an object definition.
Useful when you want to extend an existing object definition, without necessarily loading that object.
string | $id | The unique identifier for the object |
callable | $callable | A service definition to extend the original |
Definition at line 226 of file Container.php.
Pimple\Container::factory | ( | $callable | ) |
Marks a callable as being a factory service.
callable | $callable | A service definition to be used as a factory |
Definition at line 158 of file Container.php.
Pimple\Container::keys | ( | ) |
Returns all defined value names.
Definition at line 259 of file Container.php.
Pimple\Container::offsetExists | ( | $id | ) |
Checks if a parameter or an object is set.
string | $id | The unique identifier for the parameter or object |
Definition at line 128 of file Container.php.
Pimple\Container::offsetGet | ( | $id | ) |
Gets a parameter or an object.
string | $id | The unique identifier for the parameter or object |
Definition at line 93 of file Container.php.
Pimple\Container::offsetSet | ( | $id, | |
$value | |||
) |
Sets a parameter or an object.
Objects must be defined as Closures.
Allowing any PHP callable leads to difficult to debug problems as function names (strings) are callable (creating a function with the same name as an existing parameter would break your container).
string | $id | The unique identifier for the parameter or object |
mixed | $value | The value of the parameter or a closure to define an object |
Definition at line 74 of file Container.php.
Pimple\Container::offsetUnset | ( | $id | ) |
Unsets a parameter or an object.
string | $id | The unique identifier for the parameter or object |
Definition at line 138 of file Container.php.
Pimple\Container::protect | ( | $callable | ) |
Protects a callable from being interpreted as a service.
This is useful when you want to store a callable as a parameter.
callable | $callable | A callable to protect from being evaluated |
Definition at line 180 of file Container.php.
Pimple\Container::raw | ( | $id | ) |
Gets a parameter or the closure defining an object.
string | $id | The unique identifier for the parameter or object |
Definition at line 200 of file Container.php.
Pimple\Container::register | ( | ServiceProviderInterface | $provider, |
array | $values = array() |
||
) |
Registers a service provider.
ServiceProviderInterface | $provider | A ServiceProviderInterface instance |
array | $values | An array of values that customizes the provider |
Definition at line 272 of file Container.php.
References Pimple\ServiceProviderInterface\register().
|
private |
Definition at line 37 of file Container.php.
|
private |
Definition at line 39 of file Container.php.
|
private |
Definition at line 41 of file Container.php.
|
private |
Definition at line 38 of file Container.php.
|
private |
Definition at line 40 of file Container.php.
|
private |
Definition at line 36 of file Container.php.