summaryrefslogtreecommitdiff
path: root/app/Pagination/SubtaskPagination.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/Pagination/SubtaskPagination.php')
-rw-r--r--app/Pagination/SubtaskPagination.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/Pagination/SubtaskPagination.php b/app/Pagination/SubtaskPagination.php
new file mode 100644
index 00000000..83593b5e
--- /dev/null
+++ b/app/Pagination/SubtaskPagination.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Kanboard\Pagination;
+
+use Kanboard\Core\Base;
+use Kanboard\Core\Paginator;
+use Kanboard\Model\TaskModel;
+
+/**
+ * Class SubtaskPagination
+ *
+ * @package Kanboard\Pagination
+ * @author Frederic Guillot
+ */
+class SubtaskPagination extends Base
+{
+ /**
+ * Get dashboard pagination
+ *
+ * @access public
+ * @param integer $userId
+ * @return Paginator
+ */
+ public function getDashboardPaginator($userId)
+ {
+ return $this->paginator
+ ->setUrl('DashboardController', 'subtasks', array('user_id' => $userId))
+ ->setMax(50)
+ ->setOrder(TaskModel::TABLE.'.priority')
+ ->setDirection('DESC')
+ ->setFormatter($this->taskListSubtaskAssigneeFormatter->withUserId($userId)->withoutEmptyTasks())
+ ->setQuery($this->taskFinderModel->getUserQuery($userId))
+ ->calculate();
+ }
+}