You are here

public static function CacheFragmentController::lookUpHashes in RESTful 7.2

Gets the hashes for an EFQ.

Parameters

\EntityFieldQuery $query: The EFQ.

Return value

string[] The hashes that meet the conditions.

4 calls to CacheFragmentController::lookUpHashes()
CacheDecoratedResource::invalidateResourceCache in src/Plugin/resource/Decorators/CacheDecoratedResource.php
Invalidates the resource cache for the given resource on the provided id.
restful_user_delete in ./restful.entity.inc
Implements hook_user_delete().
restful_user_update in ./restful.entity.inc
Implements hook_user_update().
_restful_entity_cache_hashes in ./restful.entity.inc
Helper function that extract cache hashes from an entity.

File

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

Class

CacheFragmentController
Class CacheFragmentController.

Namespace

Drupal\restful\RenderCache\Entity

Code

public static function lookUpHashes(\EntityFieldQuery $query) {
  $results = $query
    ->execute();
  if (empty($results[static::ENTITY_TYPE])) {
    return array();
  }
  $fragment_ids = array_keys($results[static::ENTITY_TYPE]);
  $hashes = db_query('SELECT hash FROM {' . static::getTableName() . '} WHERE ' . static::getTableIdkey() . ' IN (:ids)', array(
    ':ids' => $fragment_ids,
  ))
    ->fetchCol();
  return $hashes;
}