You are here

protected function AnnotatedClassDiscovery::prepareAnnotationDefinition in Plug 7

Same name in this branch
  1. 7 lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery::prepareAnnotationDefinition()
  2. 7 lib/Drupal/Component/Annotation/Plugin/Discovery/AnnotatedClassDiscovery.php \Drupal\Component\Annotation\Plugin\Discovery\AnnotatedClassDiscovery::prepareAnnotationDefinition()

Prepares the annotation definition.

Parameters

\Drupal\Component\Annotation\AnnotationInterface $annotation: The annotation derived from the plugin.

string $class: The class used for the plugin.

Overrides AnnotatedClassDiscovery::prepareAnnotationDefinition

File

lib/Drupal/Core/Plugin/Discovery/AnnotatedClassDiscovery.php, line 88
Contains \Drupal\Core\Plugin\Discovery\AnnotatedClassDiscovery.

Class

AnnotatedClassDiscovery
Defines a discovery mechanism to find annotated plugins in PSR-0 namespaces.

Namespace

Drupal\Core\Plugin\Discovery

Code

protected function prepareAnnotationDefinition(AnnotationInterface $annotation, $class) {
  parent::prepareAnnotationDefinition($annotation, $class);
  if (!$annotation
    ->getProvider()) {
    $annotation
      ->setProvider($this
      ->getProviderFromNamespace($class));
  }
}