示例#1
0
 /**
  * Delete a group
  *
  * 
  * @param int $id The ID of the group to delete
  * @return
  */
 public function delete($id = 0)
 {
     $this->load->model('users/user_m');
     // don't delete the group if there are still users assigned to it
     if ($this->user_m->count_by(array('group_id' => $id)) > 0) {
         return false;
     }
     // Dont let them delete the "admin" group or the "user" group.
     // The interface does not have a delete button for these, this is just insurance
     $this->db->where_not_in('name', array('user', 'admin'));
     return parent::delete($id);
 }