add firstresult/maxresult in SingleTaskRepository

This commit is contained in:
Julien Fastré 2018-04-26 12:35:03 +02:00
parent eadaeaef35
commit 4a8e252fdb

View File

@ -74,14 +74,21 @@ class SingleTaskRepository extends \Doctrine\ORM\EntityRepository
*
* @param type $params
* @param User $currentUser
* @param int $firstResult
* @param int $maxResults
* @return type
*/
public function findByParameters($params, User $currentUser)
public function findByParameters($params, User $currentUser, int $firstResult = 0, int $maxResults = 50)
{
$qb = $this->createQueryBuilder('st');
$this->buildQuery($qb, $params, $currentUser);
$qb
->setMaxResults($maxResults)
->setFirstResult($firstResult)
;
return $qb
->getQuery()
->getResult()