ContainerAwareTrait

Defines the trait for a Container Aware Class.

since

1.2

note

Traits are available in PHP 5.4+

package

Joomla Framework

Methods

getContainer

Get the DI container.

getContainer() : \Joomla\DI\Container
since

1.2

throws

\UnexpectedValueExceptionMay be thrown if the container has not been set.

note

As of 2.0 this method will be protected.

Response

\Joomla\DI\Container

setContainer

Set the DI container.

setContainer(\Joomla\DI\Container container) : mixed
since

1.2

Arguments

container

\Joomla\DI\ContainerThe DI container.

Response

mixedReturns itself to support chaining.

Properties

container

DI Container

since

1.2

Type(s)

\Joomla\DI\Container