Class ServiceLocator (namespace Nette)
Service locator pattern implementation.
Object | --ServiceLocator
Implements interfaces:
| Public Method Summary | |
|---|---|
| ServiceLocator |
|
| 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.
|
| Methods Inherited From Object |
|---|
| extensionMethod(), getClass(), getReflection(), __call(), __callStatic(), __get(), __isset(), __set(), __unset() |
| Method Details | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
line 52 __constructpublic ServiceLocator __construct ([IServiceLocator $parent =
|
||||||||||||||||||||||||
|
line 67 addServicepublic void addService (mixed $service, [string $name = Adds the specified service to the service container. Implementation of:
|
||||||||||||||||||||||||
|
line 185 getParentpublic IServiceLocator|NULL getParent () Returns the parent container if any. Implementation of:
|
||||||||||||||||||||||||
|
line 130 getServicepublic mixed getService (string $name, [bool $need = Gets the service object of the specified type. Implementation of:
|
||||||||||||||||||||||||
|
line 108 removeServicepublic void removeService (bool $name, [$promote = Removes the specified service type from the service container. Implementation of:
|
||||||||||||||||||||||||
