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

Breadcrumb

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

function Container::has

Same name in this branch
  1. 11.1.x core/lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container::has()

Overrides ContainerInterface::has

3 calls to Container::has()
Container::getEnv in vendor/symfony/dependency-injection/Container.php
Fetches a variable from the environment.
ContainerBuilder::has in vendor/symfony/dependency-injection/ContainerBuilder.php
Returns true if the container can return an entry for the given identifier. Returns false otherwise.
ContainerBuilder::has in vendor/symfony/dependency-injection/ContainerBuilder.php
Returns true if the container can return an entry for the given identifier. Returns false otherwise.
1 method overrides Container::has()
ContainerBuilder::has in vendor/symfony/dependency-injection/ContainerBuilder.php
Returns true if the container can return an entry for the given identifier. Returns false otherwise.

File

vendor/symfony/dependency-injection/Container.php, line 176

Class

Container
Container is a dependency injection container.

Namespace

Symfony\Component\DependencyInjection

Code

public function has(string $id) : bool {
    if (isset($this->aliases[$id])) {
        $id = $this->aliases[$id];
    }
    if (isset($this->services[$id])) {
        return true;
    }
    if ('service_container' === $id) {
        return true;
    }
    return isset($this->fileMap[$id]) || isset($this->methodMap[$id]);
}

API Navigation

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