You are here

function _restful_entity_clear_all_resources in RESTful 7.2

Clear the cache back ends for the given hash.

Parameters

string $cid: The cache ID to clear.

4 string references to '_restful_entity_clear_all_resources'
restful_entity_delete in ./restful.entity.inc
Implements hook_entity_delete().
restful_entity_update in ./restful.entity.inc
Implements hook_entity_update().
restful_user_delete in ./restful.entity.inc
Implements hook_user_delete().
restful_user_update in ./restful.entity.inc
Implements hook_user_update().

File

./restful.entity.inc, line 153
Contains entity related code.

Code

function _restful_entity_clear_all_resources($cid) {
  if (!($instance_id = CacheFragmentController::resourceIdFromHash($cid))) {
    return;
  }
  $handler = restful()
    ->getResourceManager()
    ->getPlugin($instance_id);
  if (!$handler instanceof CacheDecoratedResourceInterface) {
    return;
  }

  // Clear the cache bin.
  $handler
    ->getCacheController()
    ->clear($cid);
}