public function ContainerBuilder::register

Registers a service definition.

This methods allows for simple registration of service definition with a fluid interface.

@api

Parameters

string $id The service identifier:

string $class The service class:

Return value

Definition A Definition instance

File

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

Class

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

Namespace

Symfony\Component\DependencyInjection

Code

public function register($id, $class = null) {
  return $this
    ->setDefinition(strtolower($id), new Definition($class));
}