You are here

public function ContainerBuilder::hasDefinition 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::hasDefinition()

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

@api

Parameters

string $id The service identifier:

Return value

bool true if the service definition exists, false otherwise

File

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

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);
}