Drupal::hasService

public static Drupal::hasService($id)

Indicates if a service is defined in the container.

Parameters

string $id: The ID of the service to check.

Return value

bool TRUE if the specified service exists, FALSE otherwise.

File

core/lib/Drupal.php, line 170
Contains \Drupal.

Class

Drupal
Static Service Container wrapper.

Code

public static function hasService($id) {
  // Check hasContainer() first in order to always return a Boolean.
  return static::hasContainer() && static::getContainer()->has($id);
}
doc_Drupal
2016-10-29 09:02:46
Comments
Leave a Comment

Please login to continue.