deleteProfileGroup() public static method

Delete a membership of a profile in a group.
public static deleteProfileGroup ( integer $id )
$id integer Id of the membership.
Example #1
0
 /**
  * Execute the action.
  */
 public function execute()
 {
     // get parameters
     $this->id = $this->getParameter('id', 'int');
     // does the item exist
     if ($this->id !== null && BackendProfilesModel::existsProfileGroup($this->id)) {
         // call parent, this will probably add some general CSS/JS or other required files
         parent::execute();
         // get profile group
         $profileGroup = BackendProfilesModel::getProfileGroup($this->id);
         // delete profile group
         BackendProfilesModel::deleteProfileGroup($this->id);
         // trigger event
         BackendModel::triggerEvent($this->getModule(), 'after_profile_delete_from_group', array('id' => $this->id));
         // profile group was deleted, so redirect
         $this->redirect(BackendModel::createURLForAction('edit') . '&id=' . $profileGroup['profile_id'] . '&report=membership-deleted#tabGroups');
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }