class Container

Same name in this branch
  1. 10 core/lib/Drupal/Core/Render/Element/Container.php \Drupal\Core\Render\Element\Container
  2. 10 core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Render/Element/Container.php \Drupal\Core\Render\Element\Container
  2. 9 core/lib/Drupal/Core/DependencyInjection/Container.php \Drupal\Core\DependencyInjection\Container
  3. 9 core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container
  4. 8.9.x core/lib/Drupal/Core/Render/Element/Container.php \Drupal\Core\Render\Element\Container
  5. 8.9.x core/lib/Drupal/Core/DependencyInjection/Container.php \Drupal\Core\DependencyInjection\Container
  6. 8.9.x core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container
  7. 11.x core/lib/Drupal/Core/Render/Element/Container.php \Drupal\Core\Render\Element\Container
  8. 11.x core/lib/Drupal/Core/DependencyInjection/Container.php \Drupal\Core\DependencyInjection\Container
  9. 11.x core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container

Extends the container to prevent serialization.

Hierarchy

Expanded class hierarchy of Container

14 files declare their use of Container
BlockPageVariantTest.php in core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php
CacheTest.php in core/tests/Drupal/Tests/Core/Cache/CacheTest.php
ContainerTest.php in core/tests/Drupal/Tests/Core/DependencyInjection/ContainerTest.php
DefaultMenuLinkTreeManipulatorsTest.php in core/tests/Drupal/Tests/Core/Menu/DefaultMenuLinkTreeManipulatorsTest.php
EntityAccessCheckTest.php in core/tests/Drupal/Tests/Core/Entity/EntityAccessCheckTest.php

... See full list

18 string references to 'Container'
Actions::getInfo in core/lib/Drupal/Core/Render/Element/Actions.php
Returns the element properties for this element.
AddHandler::buildForm in core/modules/views_ui/src/Form/Ajax/AddHandler.php
Form constructor.
ClaroVerticalTabsTest::testVerticalTabs in core/tests/Drupal/KernelTests/Core/Theme/ClaroVerticalTabsTest.php
Confirms that Claro can render vertical tabs correctly.
ClaroVerticalTabsTest::testVerticalTabs in core/tests/Drupal/KernelTests/Core/Theme/ClaroVerticalTabsTest.php
Confirms that Claro can render vertical tabs correctly.
ConfigHandler::buildForm in core/modules/views_ui/src/Form/Ajax/ConfigHandler.php
Form constructor.

... See full list

File

core/lib/Drupal/Core/DependencyInjection/Container.php, line 10

Namespace

Drupal\Core\DependencyInjection
View source
class Container extends DrupalContainer {
  
  /**
   * {@inheritdoc}
   */
  public function __sleep() {
    assert(FALSE, 'The container was serialized.');
    return array_keys(get_object_vars($this));
  }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Container::$aliases protected property The aliases of the container.
Container::$frozen protected property Whether the container parameters can still be changed.
Container::$loading protected property The currently loading services.
Container::$parameters protected property The parameters of the container.
Container::$privateServices protected property The instantiated private services.
Container::$serviceDefinitions protected property The service definitions of the container.
Container::$services protected property The instantiated services.
Container::createService protected function Creates a service from a service definition. 1
Container::get public function 2
Container::getAlternatives protected function Provides alternatives for a given array and key.
Container::getParameter public function
Container::getParameterAlternatives protected function Provides alternatives in case a parameter was not found.
Container::getServiceAlternatives protected function Provides alternatives in case a service was not found.
Container::getServiceIds public function Gets all defined service IDs. Overrides ContainerInterface::getServiceIds
Container::has public function
Container::hasParameter public function
Container::initialized public function
Container::reset public function Resets shared services from the container.
Container::resolveServicesAndParameters protected function Resolves arguments that represent services or variables to the real values. 1
Container::set public function phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
Container::setParameter public function phpcs:ignore Drupal.Commenting.FunctionComment.VoidReturn
Container::__clone private function Ensure that cloning doesn't work.
Container::__construct public function Constructs a new Container instance. 1
Container::__sleep public function

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.