public static function EntityCacheControllerHelper::entityCacheGet in Entity cache 7
1 call to EntityCacheControllerHelper::entityCacheGet()
- EntityCacheControllerHelper::entityCacheLoad in includes/
entitycache.entitycachecontrollerhelper.inc - Loads entities by IDs/conditions, which are potentially cached.
File
- includes/
entitycache.entitycachecontrollerhelper.inc, line 232 - EntityCacheControllerHelper cache helper.
Class
- EntityCacheControllerHelper
- Entity cache helper.
Code
public static function entityCacheGet($controller, $ids, $conditions = array()) {
drupal_alter('entitycache_pre_cache_get', $ids, $conditions, $controller->entityType);
$cached_entities = array();
if ($ids && !$conditions) {
$cached = cache_get_multiple($ids, 'cache_entity_' . $controller->entityType);
if ($cached) {
foreach ($cached as $item) {
$cached_entities[$item->cid] = $item->data;
}
self::entityCacheAttachLoad($controller, $cached_entities);
}
}
return $cached_entities;
}