/**
  * Overrides DrupalDefaultEntityController::load().
  */
 public function load($ids = array(), $conditions = array())
 {
     if (module_exists('entitycache')) {
         return EntityCacheControllerHelper::entityCacheLoad($this, $ids, $conditions);
     } else {
         return parent::load($ids, $conditions);
     }
 }
示例#2
0
 /**
  * Overrides DrupalDefaultEntityController::attachLoad().
  */
 protected function attachLoad(&$queried_entities, $revision_id = FALSE)
 {
     foreach ($queried_entities as $entity) {
         // Load the states, so they are already present on the next (cached) load.
         $entity->states = $entity->getStates($all = TRUE);
         $entity->transitions = $entity->getTransitions(FALSE);
         $entity->typeMap = $entity->getTypeMap();
     }
     parent::attachLoad($queried_entities, $revision_id);
 }
 /**
  * Save Playlist Type.
  */
 public function save($entity, DatabaseTransaction $transaction = NULL)
 {
     parent::save($entity, $transaction);
     // Rebuild menu registry. We do not call menu_rebuild directly, but set
     // variable that indicates rebuild in the end.
     // @see http://drupal.org/node/139961
     variable_set('menu_rebuild_needed', TRUE);
 }