Get a program by it's driver

This commit is contained in:
Eike Foken
2011-08-30 20:47:28 +02:00
parent faac255555
commit 96d164308b

View File

@@ -62,8 +62,8 @@ class Program extends CI_Model {
* @param string $id The ID of the program to update * @param string $id The ID of the program to update
* @return boolean Returns TRUE if the update was successful * @return boolean Returns TRUE if the update was successful
*/ */
public function update($name, $id) { public function update($data, $id) {
$this->db->update('programs', array('name' => $name), array('id' => $id)); $this->db->update('programs', $data, array('id' => $id));
return $this->db->affected_rows() > 0; return $this->db->affected_rows() > 0;
} }
@@ -96,6 +96,16 @@ class Program extends CI_Model {
return $this->db->get_where('programs', array('id' => $id))->row_array(); return $this->db->get_where('programs', array('id' => $id))->row_array();
} }
/**
* Gets a specific program by it's driver's name.
*
* @param string $driver The driver
* @return array Declarative array with all available information of the program.
*/
public function getByDriver($driver) {
return $this->db->get_where('programs', array('driver' => $driver))->row_array();
}
/** /**
* Get a program's available parameters by program id. * Get a program's available parameters by program id.
* *