24 lines
554 B
PHP
24 lines
554 B
PHP
<?php
|
|
|
|
namespace App\Repository;
|
|
|
|
use App\Core\Repository\RepositoryQuery;
|
|
use Knp\Component\Pager\PaginatorInterface;
|
|
use App\Repository\DebriefingRepository as Repository;
|
|
|
|
class DebriefingRepositoryQuery extends RepositoryQuery
|
|
{
|
|
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
|
{
|
|
parent::__construct($repository, 'd', $paginator);
|
|
}
|
|
|
|
public function latest(int $max = 5)
|
|
{
|
|
return $this
|
|
->addOrderBy('.date', 'DESC')
|
|
->setMaxResults($max)
|
|
;
|
|
}
|
|
}
|