From 1afccc3b9c6ade5e9ac9cfef927229c5b829a846 Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Sun, 8 May 2011 20:16:45 +0200 Subject: [PATCH] Add create() and delete() to job model --- application/models/job.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/application/models/job.php b/application/models/job.php index b41f906..c1dd4cb 100644 --- a/application/models/job.php +++ b/application/models/job.php @@ -5,6 +5,25 @@ */ class Job extends CI_Model { + /** + * Create a new job. + * + * @param array $data the data of the new job + * @return bool was the insert successful + */ + public function create($data) { + return $this->db->insert('jobs', $data); + } + + /** + * Delete a job. + * @param string the job id to delete + * @return bool was the deletion successful + */ + public function delete($job_id) { + return $this->db->delete('jobs', array('id' => $job_id)); + } + /** * Update the progress of a given job. *