You are here

public function SimpleAnnotationReader::getClassAnnotation in Plug 7

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

object|null The Annotation or NULL, if the requested annotation does not exist.

Overrides Reader::getClassAnnotation

File

lib/doctrine/annotations/lib/Doctrine/Common/Annotations/SimpleAnnotationReader.php, line 89

Class

SimpleAnnotationReader
Simple Annotation Reader.

Namespace

Doctrine\Common\Annotations

Code

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