You are here

public function FileCacheReader::getClassAnnotation in Service Container 7

Same name and namespace in other branches
  1. 7.2 modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php \Doctrine\Common\Annotations\FileCacheReader::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

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

Overrides Reader::getClassAnnotation

File

modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/FileCacheReader.php, line 198

Class

FileCacheReader
File cache reader for 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;
}