Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ContainerBuilder.php

function ContainerBuilder::get

Throws

InvalidArgumentException when no definitions are available

ServiceCircularReferenceException When a circular reference is detected

ServiceNotFoundException When the service is not defined

\Exception

Overrides Container::get

See also

Reference

File

vendor/symfony/dependency-injection/ContainerBuilder.php, line 565

Class

ContainerBuilder
ContainerBuilder is a DI container that provides an API to easily describe services.

Namespace

Symfony\Component\DependencyInjection

Code

public function get(string $id, int $invalidBehavior = ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE) : ?object {
    if ($this->isCompiled() && isset($this->removedIds[$id])) {
        return ContainerInterface::EXCEPTION_ON_INVALID_REFERENCE >= $invalidBehavior ? parent::get($id) : null;
    }
    return $this->doGet($id, $invalidBehavior);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal