Created
February 25, 2015 23:33
-
-
Save gabesullice/cecdcca780b651413ee0 to your computer and use it in GitHub Desktop.
Demonstrates enabling entitycache for custom entities.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* The Bean Entity cache module. | |
*/ | |
/** | |
* Implements hook_entity_info_alter(). | |
*/ | |
function bean_entitycache_entity_info_alter(&$entity_info) { | |
// Enable Entity Cache support for beans. | |
$entity_info['bean']['entity cache'] = TRUE; | |
// Which means that we don't need to cache the fields. | |
$entity_info['bean']['field cache'] = FALSE; | |
// Provide bean entitycache controller so other modules using entitycache can | |
// work with beans. | |
$entity_info['bean']['controller class'] = 'BeanEntityCacheAPIController'; | |
} | |
/** | |
* Implements hook_flush_caches(). | |
*/ | |
function bean_entitycache_flush_caches() { | |
return array('cache_entity_bean'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment