You are here

function _makemeeting_clear_related_entity_cache in Make Meeting Scheduler 7.2

Invalidate related entity caches.

Clear the core page cache and the contrib Entity Cache of the entity.

Parameters

$entity_type:

$entity_id:

3 calls to _makemeeting_clear_related_entity_cache()
makemeeting_answers_form_submit in ./makemeeting.form.inc
Form submit: store answers
makemeeting_delete_answer_submit in ./makemeeting.pages.inc
Form callback: confirm answer deletion
_makemeeting_clear_referencing_entity_cache in ./makemeeting.module
Invalidate referencing entities caches.

File

./makemeeting.module, line 205
Hooks and field implementations

Code

function _makemeeting_clear_related_entity_cache($entity_type, $entity_id) {

  // Clear entity_type cache.
  entity_get_controller($entity_type)
    ->resetCache();

  // Clear core page cache.
  if (variable_get('cache', FALSE)) {
    $entities = entity_load($entity_type, array(
      $entity_id,
    ));
    $entity = reset($entities);
    global $base_root;
    $uri = entity_uri($entity_type, $entity);

    // Clear the non-aliased page.
    cache_clear_all($base_root . base_path() . $uri['path'], 'cache_page');

    // Clear the aliased page.
    cache_clear_all(url($uri['path'], array(
      'absolute' => TRUE,
    )), 'cache_page');
  }

  // Clear referencing entities cache.
  if (module_exists('entityreference')) {
    _makemeeting_clear_referencing_entity_cache($entity_type, $entity_id);
  }
}