You are here

protected function CacheFragmentController::existingFragments in RESTful 7.2

Gets the existing fragments for a given hash.

Parameters

string $hash: The hash.

Return value

CacheFragment[] An array of fragments.

1 call to CacheFragmentController::existingFragments()
CacheFragmentController::createCacheFragments in src/RenderCache/Entity/CacheFragmentController.php
Creates all the caches tags from the tag collection.

File

src/RenderCache/Entity/CacheFragmentController.php, line 81
Contains \Drupal\restful\RenderCache\Entity\CacheFragmentController.

Class

CacheFragmentController
Class CacheFragmentController.

Namespace

Drupal\restful\RenderCache\Entity

Code

protected function existingFragments($hash) {
  $query = new \EntityFieldQuery();
  $results = $query
    ->entityCondition('entity_type', static::ENTITY_TYPE)
    ->propertyCondition('hash', $hash)
    ->execute();
  return empty($results[static::ENTITY_TYPE]) ? array() : $this
    ->load(array_keys($results[static::ENTITY_TYPE]));
}