diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-11-22 18:49:34 -0500 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-11-22 18:49:34 -0500 |
commit | c49d46718a07afeea017aa90a60320587211dc49 (patch) | |
tree | 68499594b8d2f6a26411249aaff12b87b4ee3628 /app/Model/TaskCreation.php | |
parent | 77e10d25829f3523a168bf61424fac99a539f8be (diff) |
Some refactoring for PHP 5.3
Diffstat (limited to 'app/Model/TaskCreation.php')
-rw-r--r-- | app/Model/TaskCreation.php | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/app/Model/TaskCreation.php b/app/Model/TaskCreation.php index 58cfa6ed..c101f659 100644 --- a/app/Model/TaskCreation.php +++ b/app/Model/TaskCreation.php @@ -20,7 +20,7 @@ class TaskCreation extends Base public function create(array $values) { $this->prepare($values); - $task_id = $this->persist($values); + $task_id = $this->persist(Task::TABLE, $values); $this->fireEvents($task_id, $values); return (int) $task_id; @@ -52,25 +52,6 @@ class TaskCreation extends Base } /** - * Save the task to the database - * - * @access private - * @param array $values Form values - * @return boolean|integer - */ - private function persist(array $values) - { - return $this->db->transaction(function($db) use ($values) { - - if (! $db->table(Task::TABLE)->save($values)) { - return false; - } - - return $db->getConnection()->getLastId(); - }); - } - - /** * Fire events * * @access private |