diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-08-13 14:23:53 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-08-13 14:23:53 -0400 |
commit | 4ffaba2ba0dd6b5810adea1916080c3b645f3d29 (patch) | |
tree | 7c216830af0f97b0c0908d63be83698cabba3922 /app/Formatter | |
parent | 29820bf83b7ee18b5f48990ce0188a9c041c3473 (diff) |
Add reference hooks
Diffstat (limited to 'app/Formatter')
-rw-r--r-- | app/Formatter/BoardFormatter.php | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/app/Formatter/BoardFormatter.php b/app/Formatter/BoardFormatter.php index 350dde6c..df443a52 100644 --- a/app/Formatter/BoardFormatter.php +++ b/app/Formatter/BoardFormatter.php @@ -44,6 +44,13 @@ class BoardFormatter extends BaseFormatter implements FormatterInterface { $swimlanes = $this->swimlaneModel->getSwimlanes($this->projectId); $columns = $this->columnModel->getAll($this->projectId); + + if (empty($swimlanes) || empty($columns)) { + return array(); + } + + $this->hook->reference('formatter:board:query', $this->query); + $tasks = $this->query ->eq(TaskModel::TABLE.'.project_id', $this->projectId) ->asc(TaskModel::TABLE.'.position') @@ -52,10 +59,6 @@ class BoardFormatter extends BaseFormatter implements FormatterInterface $task_ids = array_column($tasks, 'id'); $tags = $this->taskTagModel->getTagsByTasks($task_ids); - if (empty($swimlanes) || empty($columns)) { - return array(); - } - return BoardSwimlaneFormatter::getInstance($this->container) ->withSwimlanes($swimlanes) ->withColumns($columns) |