public function CachedReader::getPropertyAnnotations

Get annotations for property

Parameters

\ReflectionProperty $property:

Return value

array

Overrides Reader::getPropertyAnnotations

1 call to CachedReader::getPropertyAnnotations()
CachedReader::getPropertyAnnotation in drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php
Get selected annotation for property

File

drupal/core/vendor/doctrine/common/lib/Doctrine/Common/Annotations/CachedReader.php, line 117

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;
}