class Container

Same name in this branch
  1. 9 core/lib/Drupal/Core/Render/Element/Container.php \Drupal\Core\Render\Element\Container
  2. 9 core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container
Same name and namespace in other branches
  1. 7.x misc/typo3/phar-stream-wrapper/src/Phar/Container.php \TYPO3\PharStreamWrapper\Phar\Container
  2. 11.x core/lib/Drupal/Core/Render/Element/Container.php \Drupal\Core\Render\Element\Container
  3. 11.x core/lib/Drupal/Core/DependencyInjection/Container.php \Drupal\Core\DependencyInjection\Container
  4. 11.x core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container

Extends the Drupal container to set the service ID on the created object.

Hierarchy

Expanded class hierarchy of Container

20 files declare their use of Container
BlockPageVariantTest.php in core/modules/block/tests/src/Unit/Plugin/DisplayVariant/BlockPageVariantTest.php
CacheTagsInvalidatorTest.php in core/tests/Drupal/Tests/Core/Cache/CacheTagsInvalidatorTest.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

... See full list

40 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
ArgumentPluginBase::buildOptionsForm in core/modules/views/src/Plugin/views/argument/ArgumentPluginBase.php
ChooseBlockController::build in core/modules/layout_builder/src/Controller/ChooseBlockController.php
Provides the UI for choosing a new block.
ClaroPreRender::trustedCallbacks in core/themes/claro/src/ClaroPreRender.php
Lists the trusted callbacks provided by the implementing class.

... 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));
  }

}

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