refactor: move DQL in repositories

This commit is contained in:
Maël Gangloff
2025-10-21 12:52:43 +02:00
parent 1ae35231fe
commit 4facd7e951
12 changed files with 123 additions and 81 deletions

View File

@@ -110,16 +110,7 @@ class WatchListController extends AbstractController
/** @var Domain $domain */
foreach ($watchList->getDomains()->getIterator() as $domain) {
/** @var DomainEvent|null $exp */
$exp = $this->domainEventRepository->createQueryBuilder('de')
->select()
->where('de.domain = :domain')
->andWhere('de.action = \'expiration\'')
->andWhere('de.deleted = FALSE')
->orderBy('de.date', 'DESC')
->setMaxResults(1)
->getQuery()
->setParameter('domain', $domain)
->getOneOrNullResult();
$exp = $this->domainEventRepository->findLastExpirationDomainEvent($domain);
if (!$domain->getDeleted() && null !== $exp && !in_array($domain, $domains)) {
$domains[] = $domain;