Interface IServiceLocator (namespace Nette)


The service locator.


Copyright: Copyright (c) 2004, 2010 David Grudl
Located: in /IServiceLocator.php (line 21)
Public Method Summary
void
addService (string $name, mixed $service, [bool $singleton = TRUE], [$options = NULL])
Adds the specified service to the service container.
mixed
getService (string $name, [$options = NULL])
Gets the service object of the specified type.
bool
hasService ($name)
Exists the service?
void
removeService ($name)
Removes the specified service type from the service container.

Method Details

line 32

addService

public void addService (string $name, mixed $service, [bool $singleton = TRUE], [$options = NULL])

Adds the specified service to the service container.

Input
string $name service name
mixed $service object, class name or factory callback
bool $singleton is singleton?
$options factory options

line 40

getService

public mixed getService (string $name, [$options = NULL])

Gets the service object of the specified type.

Input
string $name service name
$options options in case service is not singleton

line 52

hasService

public bool hasService ($name)

Exists the service?

Input
$name

line 46

removeService

public void removeService ($name)

Removes the specified service type from the service container.

Input
$name