You are here

public function CachedReader::getPropertyAnnotations 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::getPropertyAnnotations()

Gets the annotations applied to a property.

Parameters

\ReflectionProperty $property The ReflectionProperty of the property: from which the annotations should be read.

Return value

array An array of Annotations.

Overrides Reader::getPropertyAnnotations

1 call to CachedReader::getPropertyAnnotations()
CachedReader::getPropertyAnnotation in modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php
Gets a property annotation.

File

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

Class

CachedReader
A cache aware annotation reader.

Namespace

Doctrine\Common\Annotations

Code

public function getPropertyAnnotations(\ReflectionProperty $property) {
  $class = $property
    ->getDeclaringClass();
  $cacheKey = $class
    ->getName() . '$' . $property
    ->getName();
  if (isset($this->loadedAnnotations[$cacheKey])) {
    return $this->loadedAnnotations[$cacheKey];
  }
  if (false === ($annots = $this
    ->fetchFromCache($cacheKey, $class))) {
    $annots = $this->delegate
      ->getPropertyAnnotations($property);
    $this
      ->saveToCache($cacheKey, $annots);
  }
  return $this->loadedAnnotations[$cacheKey] = $annots;
}