Add some getters to the program model

This commit is contained in:
Karsten Heiken
2011-07-31 16:40:01 +02:00
parent b81794fe77
commit 052b32cc05

View File

@@ -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.
*