suivi/src/Repository/SpeakerRepositoryQuery.php

38 lines
912 B
PHP
Raw Normal View History

<?php
namespace App\Repository;
use App\Core\Repository\RepositoryQuery;
2022-03-06 19:12:11 +01:00
use App\Repository\SpeakerRepository as Repository;
use Knp\Component\Pager\PaginatorInterface;
2022-03-06 19:12:11 +01:00
class SpeakerRepositoryQuery extends RepositoryQuery
{
public function __construct(Repository $repository, PaginatorInterface $paginator)
{
parent::__construct($repository, 's', $paginator);
}
2022-04-17 16:38:18 +02:00
public function withIds(?array $ids)
{
if (null === $ids) {
return $this;
}
return $this
->andWhere('.id IN (:ids)')
->setParameter('ids', $ids)
;
}
public function withCalendar()
{
return $this
->andWhere('.caldavHost IS NOT NULL')
->andWhere('.caldavUsername IS NOT NULL')
->andWhere('.caldavPassword IS NOT NULL')
->andWhere('.caldavCalendarUri IS NOT NULL')
;
}
}