Interface IServiceLocator (namespace Nette)


The service locator.


Author: David Grudl
Copyright: Copyright (c) 2004, 2009 David Grudl
Located: in /IServiceLocator.php (line 29)
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 40

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 48

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 60

hasService

public bool hasService ($name)

Exists the service?

Input
$name

line 54

removeService

public void removeService ($name)

Removes the specified service type from the service container.

Input
$name