From c49d46718a07afeea017aa90a60320587211dc49 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sat, 22 Nov 2014 18:49:34 -0500 Subject: Some refactoring for PHP 5.3 --- app/Model/TaskCreation.php | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'app/Model/TaskCreation.php') 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; @@ -51,25 +51,6 @@ class TaskCreation extends Base $values['position'] = $this->taskFinder->countByColumnId($values['project_id'], $values['column_id']) + 1; } - /** - * 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 * -- cgit v1.2.3