public function OgGroup::delete in Organic groups 7
Permanently deletes the entity.
Overrides Entity::delete
See also
File
- ./
og.module, line 1285 - Enable users to create and manage groups with roles and permissions.
Class
- OgGroup
- Main class for Group entities provided by Entity API.
Code
public function delete() {
$gid = $this->gid;
// Delete group memberships.
og_membership_delete_by_gid($this->gid);
parent::delete();
og_invalidate_cache(array(
$gid,
));
// Delete roles and permissions.
og_delete_user_roles_by_group($gid, NULL, TRUE);
}