public function AnnotationReader::getPropertyAnnotation

Gets a property annotation.

Parameters

ReflectionProperty $property:

string $annotationName The name of the annotation.:

Return value

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

Overrides Reader::getPropertyAnnotation

File

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

Class

AnnotationReader
A reader for docblock annotations.

Namespace

Doctrine\Common\Annotations

Code

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