You are here

public function CachedReader::getPropertyAnnotation in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php \Doctrine\Common\Annotations\CachedReader::getPropertyAnnotation()

Gets a property annotation.

Parameters

\ReflectionProperty $property The ReflectionProperty to read the annotations from.:

string $annotationName The name of the annotation.:

Return value

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

Overrides Reader::getPropertyAnnotation

File

modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php, line 127

Class

CachedReader
A cache aware annotation reader.

Namespace

Doctrine\Common\Annotations

Code

public function getPropertyAnnotation(\ReflectionProperty $property, $annotationName) {
  foreach ($this
    ->getPropertyAnnotations($property) as $annot) {
    if ($annot instanceof $annotationName) {
      return $annot;
    }
  }
  return null;
}