diff options
author | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-30 19:53:59 -0400 |
---|---|---|
committer | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-30 19:53:59 -0400 |
commit | d9dfd9d6199b15eba9510ef460e18c9245d9ab12 (patch) | |
tree | 6704134700cbc80c39b289620917d4bec011998e /models/board.php | |
parent | 34711f584651205cb6738b49df285d93a35393b5 (diff) |
Add Mysql/MariaDB support
Diffstat (limited to 'models/board.php')
-rw-r--r-- | models/board.php | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/models/board.php b/models/board.php index 723ffd85..3bff8d56 100644 --- a/models/board.php +++ b/models/board.php @@ -32,22 +32,20 @@ class Board extends Base */ public function saveTasksPosition(array $values) { - $this->db->startTransaction(); - - $results = array(); $taskModel = new Task($this->db, $this->event); + $this->db->startTransaction(); + foreach ($values as $value) { - $results[] = $taskModel->move( - $value['task_id'], - $value['column_id'], - $value['position'] - ); + if (! $taskModel->move($value['task_id'], $value['column_id'], $value['position'])) { + $this->db->cancelTransaction(); + return false; + } } $this->db->closeTransaction(); - return ! in_array(false, $results, true); + return true; } /** |