Add some getters to the program model
This commit is contained in:
@@ -27,6 +27,25 @@ class Program extends CI_Model {
|
|||||||
return $this->db->delete('programs', array('id' => $program_id));
|
return $this->db->delete('programs', array('id' => $program_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get all available programs from the database.
|
||||||
|
*
|
||||||
|
* @return array Declarative array with all available information of all programs.
|
||||||
|
*/
|
||||||
|
public function getAll() {
|
||||||
|
return $this->db->get('programs')->result_array();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a specific program.
|
||||||
|
*
|
||||||
|
* @param string $prg_id The id of the program to get from the database
|
||||||
|
* @return array Declarative array with all available information of the program.
|
||||||
|
*/
|
||||||
|
public function getById($prg_id) {
|
||||||
|
return $this->db->get_where('programs', array('id' => $prg_id))->row_array();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a program's available parameters by program id.
|
* Get a program's available parameters by program id.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user