28 lines
618 B
PHP
28 lines
618 B
PHP
<?php
|
|
|
|
namespace App\Repository;
|
|
|
|
use App\Core\Repository\RepositoryQuery;
|
|
use Knp\Component\Pager\PaginatorInterface;
|
|
use App\Repository\ProjectRepository as Repository;
|
|
|
|
class ProjectRepositoryQuery extends RepositoryQuery
|
|
{
|
|
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
|
{
|
|
parent::__construct($repository, 'p', $paginator);
|
|
}
|
|
|
|
public function withIds(?array $ids)
|
|
{
|
|
if (null === $ids) {
|
|
return $this;
|
|
}
|
|
|
|
return $this
|
|
->andWhere('.id IN (:ids)')
|
|
->setParameter('ids', $ids)
|
|
;
|
|
}
|
|
}
|