public function ContainerBuilder::hasDefinition

Returns true if a service definition exists under the given identifier.

@api

Parameters

string $id The service identifier:

Return value

Boolean true if the service definition exists, false otherwise

2 calls to ContainerBuilder::hasDefinition()
ContainerBuilder::get in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php
Gets a service.
ContainerBuilder::getDefinition in drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php
Gets a service definition.

File

drupal/core/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ContainerBuilder.php, line 669

Class

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

Namespace

Symfony\Component\DependencyInjection

Code

public function hasDefinition($id) {
  return array_key_exists(strtolower($id), $this->definitions);
}