ContainerBuilder::register

public ContainerBuilder::register($id, $class = null)

Registers a service definition.

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

Parameters

string $id The service identifier:

string $class The service class:

Return value

Definition A Definition instance

Overrides ContainerBuilder::register

File

core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php, line 92

Class

ContainerBuilder
Drupal's dependency injection container builder.

Namespace

Drupal\Core\DependencyInjection

Code

public function register($id, $class = null) {
  if (strtolower($id) !== $id) {
    throw new \InvalidArgumentException("Service ID names must be lowercase: $id");
  }
  return parent::register($id, $class);
}
doc_Drupal
2016-10-29 08:56:41
Comments
Leave a Comment

Please login to continue.