38 lines
912 B
PHP
38 lines
912 B
PHP
<?php
|
|
|
|
namespace App\Repository;
|
|
|
|
use App\Core\Repository\RepositoryQuery;
|
|
use App\Repository\SpeakerRepository as Repository;
|
|
use Knp\Component\Pager\PaginatorInterface;
|
|
|
|
class SpeakerRepositoryQuery extends RepositoryQuery
|
|
{
|
|
public function __construct(Repository $repository, PaginatorInterface $paginator)
|
|
{
|
|
parent::__construct($repository, 's', $paginator);
|
|
}
|
|
|
|
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')
|
|
;
|
|
}
|
|
}
|