PHPDoc and clean-up in user and group models

This commit is contained in:
Eike Foken
2011-08-18 04:53:02 +02:00
parent c373296953
commit bb2af33af8
2 changed files with 78 additions and 50 deletions

View File

@@ -8,41 +8,40 @@
class Group extends CI_Model {
/**
* Constructor.
* Calls the parent constructor.
*/
public function __construct() {
parent::__construct();
}
/**
* get
* Gets all groups.
*
* @return object
* @return array
*/
public function get() {
return $this->db->get('groups')->result_array();
}
/**
* getGroupByID
* Gets a specific group.
*
* @return object
* @param string $id
* @return array
*/
public function getGroupByID($id) {
$this->db->where('id', $id);
return $this->db->get('groups')->row_array();
public function getByID($id) {
return $this->db->get_where('groups', array('id' => $id))->row_array();
}
/**
* getGroupByName
* Gets a specific group by it's name.
*
* @return object
* @param string $name
* @return array
*/
public function getGroupByName($name) {
$this->db->where('name', $name);
return $this->db->get('groups')->row_array();
public function getByName($name) {
return $this->db->get_where('groups', array('name' => $name))->row_array();
}
}
/* End of file group.php */