summaryrefslogtreecommitdiff
path: root/app/Pagination/TaskPagination.php
diff options
context:
space:
mode:
authorTeamjungla{CODE} <junglacode@gmail.com>2016-08-20 13:47:12 -0500
committerTeamjungla{CODE} <junglacode@gmail.com>2016-08-20 13:47:12 -0500
commitfe8e9cdcfe3afc1475c7e7f4392d2b2cc601a12b (patch)
tree001403874e9e3716de7c6d51a9f536e9b3c3be5e /app/Pagination/TaskPagination.php
parentb1e795fc5b45369f7b9b565b1e106d2673361977 (diff)
parent98efcf21e355ed6ac3827058b99df86ca67c75bb (diff)
Merge branch 'stable' of https://github.com/kanboard/kanboard
Diffstat (limited to 'app/Pagination/TaskPagination.php')
-rw-r--r--app/Pagination/TaskPagination.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/app/Pagination/TaskPagination.php b/app/Pagination/TaskPagination.php
new file mode 100644
index 00000000..a395ab84
--- /dev/null
+++ b/app/Pagination/TaskPagination.php
@@ -0,0 +1,35 @@
+<?php
+
+namespace Kanboard\Pagination;
+
+use Kanboard\Core\Base;
+use Kanboard\Core\Paginator;
+use Kanboard\Model\TaskModel;
+
+/**
+ * Class TaskPagination
+ *
+ * @package Kanboard\Pagination
+ * @author Frederic Guillot
+ */
+class TaskPagination extends Base
+{
+ /**
+ * Get dashboard pagination
+ *
+ * @access public
+ * @param integer $user_id
+ * @param string $method
+ * @param integer $max
+ * @return Paginator
+ */
+ public function getDashboardPaginator($user_id, $method, $max)
+ {
+ return $this->paginator
+ ->setUrl('DashboardController', $method, array('pagination' => 'tasks', 'user_id' => $user_id))
+ ->setMax($max)
+ ->setOrder(TaskModel::TABLE.'.id')
+ ->setQuery($this->taskFinderModel->getUserQuery($user_id))
+ ->calculateOnlyIf($this->request->getStringParam('pagination') === 'tasks');
+ }
+}