class Container extends Object

The dependency injection container default implementation.

Constants

TAGS

TYPES

SERVICES

ALIASES

Properties

array $parameters
protected array[] $meta

Methods

__construct(array $params = array())

No description

array
getParameters()

No description

addService($name, $service)

Adds the service to the container.

void
removeService($name)

Removes the service from the container.

object
getService($name)

Gets the service object by name.

string
getServiceType($name)

Gets the service type by name.

bool
hasService($name)

Does the service exist?

bool
isCreated($name)

Is the service created?

object
createService($name, array $args = array())

Creates new instance of the service.

object
getByType($class, $need = TRUE)

Resolves service by type.

string[]
findByType($class)

Gets the service names of the specified type.

array
findByTag($tag)

Gets the service names of the specified tag.

object
createInstance($class, array $args = array())

Creates new instance using autowiring.

void
callInjects($service)

Calls all methods starting with with "inject" using autowiring.

mixed
callMethod($function, array $args = array())

Calls method using autowiring.

mixed
expand($s) deprecated

Expands %placeholders%.

__get($name) deprecated

No description

__set($name, $service) deprecated

No description

__isset($name) deprecated

No description

__unset($name) deprecated

No description

static 
getMethodName($name)

No description

Details

at line 36
__construct(array $params = array())

No description

Parameters

array $params

at line 45
array getParameters()

No description

Return Value

array

at line 57
Container addService($name, $service)

Adds the service to the container.

Parameters

$name
$service

Return Value

Container

at line 84
void removeService($name)

Removes the service from the container.

Parameters

$name

Return Value

void

at line 97
object getService($name)

Gets the service object by name.

Parameters

$name

Return Value

object

Exceptions

MissingServiceException

at line 115
string getServiceType($name)

Gets the service type by name.

Parameters

$name

Return Value

string

Exceptions

MissingServiceException

at line 134
bool hasService($name)

Does the service exist?

Parameters

$name

Return Value

bool

at line 148
bool isCreated($name)

Is the service created?

Parameters

$name

Return Value

bool

at line 164
object createService($name, array $args = array())

Creates new instance of the service.

Parameters

$name
array $args

Return Value

object

Exceptions

MissingServiceException

at line 199
object getByType($class, $need = TRUE)

Resolves service by type.

Parameters

$class
$need

Return Value

object

service or NULL

Exceptions

MissingServiceException

at line 219
string[] findByType($class)

Gets the service names of the specified type.

Parameters

$class

Return Value

string[]

at line 233
array findByTag($tag)

Gets the service names of the specified tag.

Parameters

$tag

Return Value

array

of [service name => tag attributes]

at line 249
object createInstance($class, array $args = array())

Creates new instance using autowiring.

Parameters

$class
array $args

Return Value

object

Exceptions

InvalidArgumentException

at line 270
void callInjects($service)

Calls all methods starting with with "inject" using autowiring.

Parameters

$service

Return Value

void

at line 280
mixed callMethod($function, array $args = array())

Calls method using autowiring.

Parameters

$function
array $args

Return Value

mixed

at line 298
mixed expand($s) deprecated

deprecated

Expands %placeholders%.

Parameters

$s

Return Value

mixed

at line 305
__get($name) deprecated

deprecated

No description

Parameters

$name

at line 314
__set($name, $service) deprecated

deprecated

No description

Parameters

$name
$service

at line 322
__isset($name) deprecated

deprecated

No description

Parameters

$name

at line 330
__unset($name) deprecated

deprecated

No description

Parameters

$name

at line 345
static getMethodName($name)

No description

Parameters

$name