You are here

public function ContainerBuilder::has in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php \Symfony\Component\DependencyInjection\ContainerBuilder::has()

Returns true if the given service is defined.

@api

Parameters

string $id The service identifier:

Return value

bool true if the service is defined, false otherwise

2 calls to ContainerBuilder::has()
ContainerBuilder::callMethod in lib/Drupal/Core/DependencyInjection/ContainerBuilder.php
A 1to1 copy of parent::callMethod.
ContainerBuilder::callMethod in modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/ContainerBuilder.php, line 441

Class

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

Namespace

Symfony\Component\DependencyInjection

Code

public function has($id) {
  $id = strtolower($id);
  return isset($this->definitions[$id]) || isset($this->aliasDefinitions[$id]) || parent::has($id);
}