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, [$options =
NULL ])
Gets the service object of the specified type.
|
bool |
hasService
(string $name, [bool $created =
FALSE ])
Exists the service?
|
void |
removeService
($name)
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 51 __constructpublic ServiceLocator __construct ([IServiceLocator $parent =
|
|||||||||||||||||||||
line 66 addServicepublic void addService (string $name, mixed $service, [bool $singleton = Adds the specified service to the service container. Implementation of:
|
|||||||||||||||||||||
line 201 getParentpublic IServiceLocator|NULL getParent () Returns the parent container if any.
|
|||||||||||||||||||||
line 115 getServicepublic mixed getService (string $name, [$options = Gets the service object of the specified type. Implementation of:
|
|||||||||||||||||||||
line 185 hasServicepublic bool hasService (string $name, [bool $created = Exists the service? Implementation of:
|
|||||||||||||||||||||
line 97 removeServicepublic void removeService ($name) Removes the specified service type from the service container. Implementation of:
|