Interface IServiceLocator (namespace Nette)


The service locator (EXPERIMENTAL).


Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /IServiceLocator.php (line 30)
Public Method Summary
void
addService (mixed $service, [string $name = NULL], [bool $promote = FALSE])
Adds the specified service to the service container.
IServiceLocator|NULL
Returns the parent container if any.
mixed
getService (string $name)
Gets the service object of the specified type.
void
removeService (bool $name, [$promote = TRUE])
Removes the specified service type from the service container.

Method Details

line 40

addService

public void addService (mixed $service, [string $name = NULL], [bool $promote = FALSE])

Adds the specified service to the service container.

Input
mixed $service object, class name or service factory callback
string $name optional service name (for factories is not optional)
bool $promote promote to higher level?

line 60

getParent

public IServiceLocator|NULL getParent ()

Returns the parent container if any.

line 54

getService

public mixed getService (string $name)

Gets the service object of the specified type.

Input
string $name service name

line 47

removeService

public void removeService (bool $name, [$promote = TRUE])

Removes the specified service type from the service container.

Input
bool $name promote to higher level?
$promote