2024-07-11 02:29:08 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Repository;
|
|
|
|
|
|
2025-10-25 17:26:56 +02:00
|
|
|
use App\Entity\Watchlist;
|
2024-07-11 02:29:08 +02:00
|
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
|
|
|
use Doctrine\Persistence\ManagerRegistry;
|
|
|
|
|
|
|
|
|
|
/**
|
2025-10-25 17:26:56 +02:00
|
|
|
* @extends ServiceEntityRepository<Watchlist>
|
2024-07-11 02:29:08 +02:00
|
|
|
*/
|
2025-10-25 17:26:56 +02:00
|
|
|
class WatchlistRepository extends ServiceEntityRepository
|
2024-07-11 02:29:08 +02:00
|
|
|
{
|
|
|
|
|
public function __construct(ManagerRegistry $registry)
|
|
|
|
|
{
|
2025-10-25 17:26:56 +02:00
|
|
|
parent::__construct($registry, Watchlist::class);
|
2024-07-11 02:29:08 +02:00
|
|
|
}
|
|
|
|
|
|
2025-10-21 12:52:43 +02:00
|
|
|
public function getTrackedDomainCount()
|
|
|
|
|
{
|
|
|
|
|
return $this->createQueryBuilder('w')
|
|
|
|
|
->select('COUNT(DISTINCT d.ldhName)')
|
|
|
|
|
->join('w.domains', 'd')
|
|
|
|
|
->where('d.deleted = FALSE')
|
|
|
|
|
->getQuery()->getSingleScalarResult();
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-11 02:29:08 +02:00
|
|
|
// /**
|
2025-10-25 17:26:56 +02:00
|
|
|
// * @return Watchlist[] Returns an array of Watchlist objects
|
2024-07-11 02:29:08 +02:00
|
|
|
// */
|
|
|
|
|
// public function findByExampleField($value): array
|
|
|
|
|
// {
|
|
|
|
|
// return $this->createQueryBuilder('b')
|
|
|
|
|
// ->andWhere('b.exampleField = :val')
|
|
|
|
|
// ->setParameter('val', $value)
|
|
|
|
|
// ->orderBy('b.id', 'ASC')
|
|
|
|
|
// ->setMaxResults(10)
|
|
|
|
|
// ->getQuery()
|
|
|
|
|
// ->getResult()
|
|
|
|
|
// ;
|
|
|
|
|
// }
|
|
|
|
|
|
2025-10-25 17:26:56 +02:00
|
|
|
// public function findOneBySomeField($value): ?Watchlist
|
2024-07-11 02:29:08 +02:00
|
|
|
// {
|
|
|
|
|
// return $this->createQueryBuilder('b')
|
|
|
|
|
// ->andWhere('b.exampleField = :val')
|
|
|
|
|
// ->setParameter('val', $value)
|
|
|
|
|
// ->getQuery()
|
|
|
|
|
// ->getOneOrNullResult()
|
|
|
|
|
// ;
|
|
|
|
|
// }
|
|
|
|
|
}
|