You are here

abstract class ContainerAware in Service Container 7

Same name in this branch
  1. 7 src/DependencyInjection/ContainerAware.php \Drupal\service_container\DependencyInjection\ContainerAware
  2. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerAware.php \Symfony\Component\DependencyInjection\ContainerAware
Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerAware.php \Symfony\Component\DependencyInjection\ContainerAware

A simple implementation of ContainerAwareInterface.

@author Fabien Potencier <fabien@symfony.com>

@api

Hierarchy

Expanded class hierarchy of ContainerAware

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerAware.php, line 21

Namespace

Symfony\Component\DependencyInjection
View source
abstract class ContainerAware implements ContainerAwareInterface {

  /**
   * @var ContainerInterface
   *
   * @api
   */
  protected $container;

  /**
   * Sets the Container associated with this Controller.
   *
   * @param ContainerInterface $container A ContainerInterface instance
   *
   * @api
   */
  public function setContainer(ContainerInterface $container = null) {
    $this->container = $container;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ContainerAware::$container protected property @api
ContainerAware::setContainer public function Sets the Container associated with this Controller. Overrides ContainerAwareInterface::setContainer