mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-27 18:13:48 +00:00
add limit and offset for apicontroller
This commit is contained in:
@@ -80,9 +80,19 @@ class NewsItemRepository implements ObjectRepository
|
||||
return $qb->getQuery()->getResult();
|
||||
}
|
||||
|
||||
public function findWithDateFilter()
|
||||
public function findWithDateFilter($limit = null, $offset = null)
|
||||
{
|
||||
return $this->buildQueryWithDateFilter()
|
||||
$qb = $this->buildQueryWithDateFilter();
|
||||
|
||||
if ($limit) {
|
||||
$qb->setMaxResults($limit);
|
||||
}
|
||||
|
||||
if ($offset) {
|
||||
$qb->setFirstResult($offset);
|
||||
}
|
||||
|
||||
return $qb
|
||||
->getQuery()
|
||||
->getResult();
|
||||
}
|
||||
|
Reference in New Issue
Block a user