You are here

public function Container::getServiceIds in Service Container 7

Same name in this branch
  1. 7 lib/Drupal/Component/DependencyInjection/Container.php \Drupal\Component\DependencyInjection\Container::getServiceIds()
  2. 7 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php \Symfony\Component\DependencyInjection\Container::getServiceIds()
Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php \Symfony\Component\DependencyInjection\Container::getServiceIds()

Gets all service ids.

Return value

array An array of all defined service ids

File

modules/providers/service_container_symfony/lib/Symfony/Component/DependencyInjection/Container.php, line 377

Class

Container
Container is a dependency injection container.

Namespace

Symfony\Component\DependencyInjection

Code

public function getServiceIds() {
  $ids = array();
  $r = new \ReflectionClass($this);
  foreach ($r
    ->getMethods() as $method) {
    if (preg_match('/^get(.+)Service$/', $method->name, $match)) {
      $ids[] = self::underscore($match[1]);
    }
  }
  $ids[] = 'service_container';
  return array_unique(array_merge($ids, array_keys($this->services)));
}