public DrupalKernel::setContainer(ContainerInterface $container = NULL)
Sets the container.
Parameters
ContainerInterface|null $container A ContainerInterface instance or null:
Overrides ContainerAwareInterface::setContainer
File
- core/lib/Drupal/Core/DrupalKernel.php, line 492
Class
- DrupalKernel
- The DrupalKernel class is the core of Drupal itself.
Namespace
Drupal\Core
Code
1 2 3 4 5 6 7 8 9 10 11 | public function setContainer(ContainerInterface $container = NULL) { if (isset( $this ->container)) { throw new \Exception( 'The container should not override an existing container.' ); } if ( $this ->booted) { throw new \Exception( 'The container cannot be set after a booted kernel.' ); } $this ->container = $container ; return $this ; } |
Please login to continue.