public function AnnotationReader::getClassAnnotation

Gets a class annotation.

Parameters

ReflectionClass $class The ReflectionClass of the class from which: the class annotations should be read.

string $annotationName The name of the annotation.:

Return value

mixed The Annotation or NULL, if the requested annotation does not exist.

Overrides Reader::getClassAnnotation

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/AnnotationReader.php, line 162

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;
}