Class ServiceLocator (namespace Nette)
Service locator pattern implementation.
Object | --ServiceLocator
Implements interfaces:
| Constructor Summary | |
|---|---|
| public |
|
| Method Summary | |
|---|---|
| void |
Adds the specified service to the service container.
|
| IServiceLocator|NULL |
getParent
()
Returns the parent container if any.
|
| mixed |
getService
(string $name, [bool $need =
TRUE])
Gets the service object of the specified type.
|
| void |
removeService
(bool $name, [$promote =
TRUE])
Removes the specified service type from the service container.
|
| Constructor Details | ||||||
|---|---|---|---|---|---|---|
|
line 54 __constructpublic __construct ([IServiceLocator $parent =
|
||||||
| Method Details | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 69 addServicepublic void addService (mixed $service, [string $name = Adds the specified service to the service container. Implementation of:
|
||||||||||||||||||||||||
|
line 182 getParentpublic IServiceLocator|NULL getParent () Returns the parent container if any. Implementation of:
|
||||||||||||||||||||||||
|
line 132 getServicepublic mixed getService (string $name, [bool $need = Gets the service object of the specified type. Implementation of:
|
||||||||||||||||||||||||
|
line 110 removeServicepublic void removeService (bool $name, [$promote = Removes the specified service type from the service container. Implementation of:
|
||||||||||||||||||||||||