blob: 8f1fa87c638a3ea08220a7d3e86130b3e66643fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<?php
namespace Kanboard\Pagination;
use Kanboard\Core\Base;
use Kanboard\Core\Paginator;
use Kanboard\Model\ProjectModel;
/**
* Class ProjectPagination
*
* @package Kanboard\Pagination
* @author Frederic Guillot
*/
class ProjectPagination 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' => 'projects', 'user_id' => $user_id))
->setMax($max)
->setOrder(ProjectModel::TABLE.'.name')
->setQuery($this->projectModel->getQueryColumnStats($this->projectPermissionModel->getActiveProjectIds($user_id)))
->calculateOnlyIf($this->request->getStringParam('pagination') === 'projects');
}
}
|