mirror of
https://github.com/YGGverse/YGGtracker.git
synced 2026-04-01 01:25:39 +00:00
init activity features #4
This commit is contained in:
parent
c47c8ad83b
commit
ef84fefca3
27 changed files with 1492 additions and 143 deletions
|
|
@ -20,28 +20,4 @@ class ActivityRepository extends ServiceEntityRepository
|
|||
{
|
||||
parent::__construct($registry, Activity::class);
|
||||
}
|
||||
|
||||
public function findLast(int $start = 0, int $limit = 10): array
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->orderBy('a.id', 'DESC') // same to a.added
|
||||
->setFirstResult($start)
|
||||
->setMaxResults($limit)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function findLastByApprovedField(bool $approved, int $start = 0, int $limit = 10): array
|
||||
{
|
||||
return $this->createQueryBuilder('a')
|
||||
->orderBy('a.id', 'DESC') // same to a.added
|
||||
->where('a.approved = :approved')
|
||||
->setParameter('approved', $approved)
|
||||
->setFirstResult($start)
|
||||
->setMaxResults($limit)
|
||||
->getQuery()
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue