public static Drupal::hasService($id)
Indicates if a service is defined in the container.
string $id: The ID of the service to check.
bool TRUE if the specified service exists, FALSE otherwise.
public static function hasService($id) { // Check hasContainer() first in order to always return a Boolean. return static::hasContainer() && static::getContainer()->has($id); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal.php/function/Drupal::hasService/8.1.x