You are here

protected function AnnotatedClassDiscovery::getAnnotationReader in Service Container 7.2

Same name in this branch
  1. 7.2 lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
  2. 7.2 modules/providers/service_container_annotation_discovery/src/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\service_container_annotation_discovery\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()
Same name and namespace in other branches
  1. 7 modules/providers/service_container_annotation_discovery/src/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\service_container_annotation_discovery\Plugin\Discovery\AnnotatedClassDiscovery::getAnnotationReader()

Gets the used doctrine annotation reader.

Return value

\Doctrine\Common\Annotations\Reader The annotation reader.

1 call to AnnotatedClassDiscovery::getAnnotationReader()
AnnotatedClassDiscovery::getDefinitions in modules/providers/service_container_annotation_discovery/src/Plugin/Discovery/AnnotatedClassDiscovery.php
Gets the definition of all plugins for this type.

File

modules/providers/service_container_annotation_discovery/src/Plugin/Discovery/AnnotatedClassDiscovery.php, line 85
Contains \Drupal\service_container_annotation_discovery\Plugin\Discovery\AnnotatedClassDiscovery

Class

AnnotatedClassDiscovery
TODO

Namespace

Drupal\service_container_annotation_discovery\Plugin\Discovery

Code

protected function getAnnotationReader() {
  if (!isset($this->annotationReader)) {
    $this->annotationReader = new SimpleAnnotationReader();

    // Add the namespaces from the main plugin annotation, like @EntityType.
    $namespace = substr($this->pluginDefinitionAnnotationName, 0, strrpos($this->pluginDefinitionAnnotationName, '\\'));
    $this->annotationReader
      ->addNamespace($namespace);
  }
  return $this->annotationReader;
}