You are here

function metatag_update_7019 in Metatag 7

Clear the entity_cache bins.

File

./metatag.install, line 1879
Install, update, and uninstall functions for the metatag module.

Code

function metatag_update_7019() {
  if (module_exists('entitycache')) {
    foreach (drupal_get_schema() as $table_name => $spec) {
      if (strpos($table_name, 'cache_entity_') === 0) {
        cache_clear_all('*', $table_name, TRUE);
        drupal_set_message(t("Cleared the @table cache bin", array(
          '@table' => $table_name,
        )));
      }
    }
  }
  else {
    drupal_set_message(t("The EntityCache module is not installed, nothing to do."));
  }
}