summaryrefslogtreecommitdiff
path: root/models/board.php
diff options
context:
space:
mode:
authorFrédéric Guillot <fguillot@users.noreply.github.com>2014-03-09 23:21:23 -0400
committerFrédéric Guillot <fguillot@users.noreply.github.com>2014-03-09 23:21:23 -0400
commit7749b8ed569f6d27b0bb2ed4c2040e8b61ed4422 (patch)
treeee101992e87d740bdf0362e35ea040c866986f5a /models/board.php
parent7bd4697dfca41a21f5857f83d6b29108fafb9a1e (diff)
Automatic actions
Diffstat (limited to 'models/board.php')
-rw-r--r--models/board.php10
1 files changed, 6 insertions, 4 deletions
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));