class Container in Zircon Profile 8
Same name in this branch
- 8 vendor/symfony/dependency-injection/Container.php \Symfony\Component\DependencyInjection\Container
- 8 core/lib/Drupal/Core/DependencyInjection/Container.php \Drupal\Core\DependencyInjection\Container
- 8 core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container
- 8 vendor/symfony/dependency-injection/Tests/Fixtures/php/services1-1.php \Symfony\Component\DependencyInjection\Container
- 8 core/lib/Drupal/Core/Render/Element/Container.php \Drupal\Core\Render\Element\Container
Same name and namespace in other branches
- 8.0 core/lib/Drupal/Core/DependencyInjection/Container.php \Drupal\Core\DependencyInjection\Container
Extends the Drupal container to set the service ID on the created object.
Hierarchy
- class \Drupal\Component\DependencyInjection\Container implements IntrospectableContainerInterface
- class \Drupal\Core\DependencyInjection\Container
Expanded class hierarchy of Container
12 files declare their use of Container
- BlockPageVariantTest.php in core/
modules/ block/ tests/ src/ Unit/ Plugin/ DisplayVariant/ BlockPageVariantTest.php - Contains \Drupal\Tests\block\Unit\Plugin\DisplayVariant\BlockPageVariantTest.
- CacheTagsInvalidatorTest.php in core/
tests/ Drupal/ Tests/ Core/ Cache/ CacheTagsInvalidatorTest.php - Contains \Drupal\Tests\Core\Cache\CacheTagsInvalidatorTest.
- ContainerTest.php in core/
tests/ Drupal/ Tests/ Core/ DependencyInjection/ ContainerTest.php - Contains \Drupal\Tests\Core\DependencyInjection\ContainerTest.
- DefaultMenuLinkTreeManipulatorsTest.php in core/
tests/ Drupal/ Tests/ Core/ Menu/ DefaultMenuLinkTreeManipulatorsTest.php - Contains \Drupal\Tests\Core\Menu\DefaultMenuLinkTreeManipulatorsTest.
- DependencySerializationTest.php in core/
tests/ Drupal/ Tests/ Core/ DependencyInjection/ DependencySerializationTest.php - Contains \Drupal\Tests\Core\DependencyInjection\DependencySerializationTest.
5 string references to 'Container'
- field.field.taxonomy_term.forums.forum_container.yml in core/
modules/ forum/ config/ install/ field.field.taxonomy_term.forums.forum_container.yml - core/modules/forum/config/install/field.field.taxonomy_term.forums.forum_container.yml
- Kernel::getContainerBaseClass in vendor/
symfony/ http-kernel/ Kernel.php - Gets the container's base class.
- PhpDumper::dump in vendor/
symfony/ dependency-injection/ Dumper/ PhpDumper.php - Dumps the service container as a PHP class.
- PhpDumperTest::testDump in vendor/
symfony/ dependency-injection/ Tests/ Dumper/ PhpDumperTest.php - SearchExcerptTest::testSearchExcerptSimplified in core/
modules/ search/ src/ Tests/ SearchExcerptTest.php - Tests search_excerpt() with search keywords matching simplified words.
File
- core/
lib/ Drupal/ Core/ DependencyInjection/ Container.php, line 16 - Contains \Drupal\Core\DependencyInjection\Container.
Namespace
Drupal\Core\DependencyInjectionView source
class Container extends DrupalContainer {
/**
* {@inheritdoc}
*/
public function set($id, $service, $scope = ContainerInterface::SCOPE_CONTAINER) {
parent::set($id, $service, $scope);
// Ensure that the _serviceId property is set on synthetic services as well.
if (isset($this->services[$id]) && is_object($this->services[$id]) && !isset($this->services[$id]->_serviceId)) {
$this->services[$id]->_serviceId = $id;
}
}
/**
* {@inheritdoc}
*/
public function __sleep() {
assert(FALSE, 'The container was serialized.');
return array_keys(get_object_vars($this));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Container:: |
protected | property | The aliases of the container. | |
Container:: |
protected | property | Whether the container parameters can still be changed. | |
Container:: |
protected | property | The currently loading services. | |
Container:: |
protected | property | The parameters of the container. | |
Container:: |
protected | property | The instantiated private services. | |
Container:: |
protected | property | The service definitions of the container. | |
Container:: |
protected | property | The instantiated services. | |
Container:: |
public | function |
Adds a scope to the container. Overrides ContainerInterface:: |
|
Container:: |
protected | function | Creates a service from a service definition. | 1 |
Container:: |
public | function |
Enters the given scope. Overrides ContainerInterface:: |
|
Container:: |
public | function |
Gets a service. Overrides ContainerInterface:: |
2 |
Container:: |
protected | function | Provides alternatives for a given array and key. | |
Container:: |
public | function |
Gets a parameter. Overrides ContainerInterface:: |
|
Container:: |
protected | function | Provides alternatives in case a parameter was not found. | |
Container:: |
protected | function | Provides alternatives in case a service was not found. | |
Container:: |
public | function | Gets all defined service IDs. | |
Container:: |
public | function |
Returns true if the given service is defined. Overrides ContainerInterface:: |
|
Container:: |
public | function |
Checks if a parameter exists. Overrides ContainerInterface:: |
|
Container:: |
public | function |
Whether this container has the given scope. Overrides ContainerInterface:: |
|
Container:: |
public | function |
Check for whether or not a service has been initialized. Overrides IntrospectableContainerInterface:: |
|
Container:: |
public | function |
Determines whether the given scope is currently active. Overrides ContainerInterface:: |
|
Container:: |
public | function |
Leaves the current scope, and re-enters the parent scope. Overrides ContainerInterface:: |
|
Container:: |
protected | function | Resolves arguments that represent services or variables to the real values. | 1 |
Container:: |
public | function |
Sets a service. Overrides Container:: |
|
Container:: |
public | function |
Sets a parameter. Overrides ContainerInterface:: |
|
Container:: |
public | function | Constructs a new Container instance. | 1 |
Container:: |
public | function | ||
ContainerInterface:: |
constant | |||
ContainerInterface:: |
constant | |||
ContainerInterface:: |
constant | |||
ContainerInterface:: |
constant | |||
ContainerInterface:: |
constant |