Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. AnnotationReader.php

function AnnotationReader::getClassAnnotation

Overrides Reader::getClassAnnotation

File

vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php, line 155

Class

AnnotationReader
A reader for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

public function getClassAnnotation(ReflectionClass $class, $annotationName) {
    $annotations = $this->getClassAnnotations($class);
    foreach ($annotations as $annotation) {
        if ($annotation instanceof $annotationName) {
            return $annotation;
        }
    }
    return null;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal