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

@@ -16,6 +16,15 @@ class WatchListRepository extends ServiceEntityRepository
parent::__construct($registry, WatchList::class);
}
public function getTrackedDomainCount()
{
return $this->createQueryBuilder('w')
->select('COUNT(DISTINCT d.ldhName)')
->join('w.domains', 'd')
->where('d.deleted = FALSE')
->getQuery()->getSingleScalarResult();
}
// /**
// * @return WatchList[] Returns an array of WatchList objects
// */