From 7749b8ed569f6d27b0bb2ed4c2040e8b61ed4422 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Sun, 9 Mar 2014 23:21:23 -0400 Subject: Automatic actions --- models/board.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'models/board.php') diff --git a/models/board.php b/models/board.php index 1a5b8b81..2835f02f 100644 --- a/models/board.php +++ b/models/board.php @@ -2,6 +2,9 @@ namespace Model; +require_once __DIR__.'/base.php'; +require_once __DIR__.'/task.php'; + use \SimpleValidator\Validator; use \SimpleValidator\Validators; @@ -14,8 +17,8 @@ class Board extends Base { $this->db->startTransaction(); - $taskModel = new \Model\Task; $results = array(); + $taskModel = new Task($this->db, $this->event); foreach ($values as $value) { $results[] = $taskModel->move( @@ -30,7 +33,7 @@ class Board extends Base return ! in_array(false, $results, true); } - // Create board with default columns => must executed inside a transaction + // Create board with default columns => must be executed inside a transaction public function create($project_id, array $columns) { $position = 0; @@ -75,11 +78,10 @@ class Board extends Base // Get columns and tasks for each column public function get($project_id) { - $taskModel = new \Model\Task; - $this->db->startTransaction(); $columns = $this->getColumns($project_id); + $taskModel = new Task($this->db, $this->event); foreach ($columns as &$column) { $column['tasks'] = $taskModel->getAllByColumnId($project_id, $column['id'], array(1)); -- cgit v1.2.3