function og_invalidate_cache in Organic groups 7.2
Same name and namespace in other branches
- 7 og.module \og_invalidate_cache()
Invalidate cache.
Parameters
$gids: Array with group IDs that their cache should be invalidated.
14 calls to og_invalidate_cache()
- OgMembership::delete in includes/
og.membership.inc - Permanently deletes the entity.
- OgMembership::save in includes/
og.membership.inc - Override Entity::save().
- OgUiManagePeopleTestCase::testOgUiAddPeople in og_ui/
og_ui.test - Test adding people via group/[entity_type]/[etid]/admin/people/add-user.
- OgUiUserPermissionsTestCase::testOgUiUserPermissionChanges in og_ui/
og_ui.test - Change user permissions and check og_user_access().
- og_create_field in ./
og.module - Create an organic groups field in a bundle.
File
- ./
og.module, line 1853 - 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_user_access_alter',
'og_role_permissions',
'og_get_user_roles',
'og_get_permissions',
'og_get_group_audience_fields',
'og_get_entity_groups',
'og_get_membership',
'og_get_field_og_membership_properties',
'og_get_user_roles',
);
foreach ($caches as $cache) {
drupal_static_reset($cache);
}
// Let other OG modules know we invalidate cache.
module_invoke_all('og_invalidate_cache', $gids);
}