getGroup() public static method

Get information about a profile group.
public static getGroup ( integer $id ) : array
$id integer Id of the group.
return array
Exemplo n.º 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::existsGroup($this->id)) {
         // call parent, this will probably add some general CSS/JS or other required files
         parent::execute();
         // get group
         $group = BackendProfilesModel::getGroup($this->id);
         // delete group
         BackendProfilesModel::deleteGroup($this->id);
         // trigger event
         BackendModel::triggerEvent($this->getModule(), 'after_delete_group', array('id' => $this->id));
         // group was deleted, so redirect
         $this->redirect(BackendModel::createURLForAction('Groups') . '&report=deleted&var=' . rawurlencode($group['name']));
     } else {
         $this->redirect(BackendModel::createURLForAction('Groups') . '&error=non-existing');
     }
 }
Exemplo n.º 2
0
 /**
  * Get the data for a question
  */
 private function getData()
 {
     // get general info
     $this->group = BackendProfilesModel::getGroup($this->id);
 }