function _restful_entity_cache_hashes in RESTful 7.2
Helper function that extract cache hashes from an entity.
2 calls to _restful_entity_cache_hashes()
- restful_entity_delete in ./
restful.entity.inc - Implements hook_entity_delete().
- restful_entity_update in ./
restful.entity.inc - Implements hook_entity_update().
File
- ./
restful.entity.inc, line 61 - Contains entity related code.
Code
function _restful_entity_cache_hashes($entity, $type) {
if ($type == 'cache_fragment') {
return array();
}
// Limit to the fragments for our entity type.
list($entity_id) = entity_extract_ids($type, $entity);
$query = new \EntityFieldQuery();
$query
->entityCondition('entity_type', 'cache_fragment')
->propertyCondition('type', 'entity')
->propertyCondition('value', CacheDecoratedResource::serializeKeyValue($type, $entity_id));
return CacheFragmentController::lookUpHashes($query);
}