Add create() and delete() to server model

This commit is contained in:
Karsten Heiken
2011-05-08 20:13:08 +02:00
parent 516651f2e2
commit c7f9166b18

View File

@@ -5,6 +5,26 @@
*/ */
class Server extends CI_Model { class Server extends CI_Model {
/**
* Create a new server.
*
* @param array $data the server informations
* @return bool was the insert successful
*/
public function create($data) {
return $this->db->insert('servers', $data);
}
/**
* Delete a server.
*
* @param string $server_id
* @return bool was the deletion successful
*/
public function delete($server_id) {
return $this->db->delete('servers', array('id' => $server_id));
}
/** /**
* Get a list of all available servers. * Get a list of all available servers.
* *