diff --git a/application/models/program.php b/application/models/program.php index 3f1da68..f49d495 100644 --- a/application/models/program.php +++ b/application/models/program.php @@ -27,6 +27,25 @@ class Program extends CI_Model { 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. *