You are here

function og_invalidate_cache in Organic groups 7

Same name and namespace in other branches
  1. 7.2 og.module \og_invalidate_cache()

Invalidate cache.

Parameters

$gids: Array with group IDs that their cache should be invalidated.

8 calls to og_invalidate_cache()
OgGroup::delete in ./og.module
Permanently deletes the entity.
OgGroup::save in ./og.module
Permanently saves the entity.
og_group in ./og.module
Set an association (e.g. subscribe) an entity to a group.
og_role_delete in ./og.module
Delete a user role from database.
og_role_grant_permissions in ./og.module
Grant permissions to a user role.

... See full list

File

./og.module, line 1413
Enable users to create and manage groups with roles and permissions.

Code

function og_invalidate_cache($gids = array()) {

  // Reset static cache.
  $caches = array(
    'og_user_access',
    'og_get_group_ids',
    'og_field_audience_options',
    'og_role_permissions',
    'og_field_formatter_view',
    'og_get_permissions',
  );
  foreach ($caches as $cache) {
    drupal_static_reset($cache);
  }

  // Invalidate group membersihp cache.
  og_group_membership_invalidate_cache();

  // Let other Group modules know we invalidate cache.
  module_invoke_all('og_invalidate_cache', $gids);
}