You are here

function crumbs_DIC_AbstractServiceContainer::__get in Crumbs, the Breadcrumbs suite 7.2

Magic method that is triggered when someone calls $container->$name.

Parameters

string $name: The machine name of the service. Must be a valid PHP identifier, without commas and such.

Return value

object

File

lib/DIC/AbstractServiceContainer.php, line 22

Class

crumbs_DIC_AbstractServiceContainer
Dependency injection container for lazy-instantiated services.

Code

function __get($name) {
  return isset($this->services[$name]) ? $this->services[$name] : ($this->services[$name] = $this
    ->createService($name));
}