mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-29 16:15:04 +00:00
53 lines
1.5 KiB
PHP
53 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Repository;
|
|
|
|
use App\Entity\Watchlist;
|
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
use Doctrine\Persistence\ManagerRegistry;
|
|
|
|
/**
|
|
* @extends ServiceEntityRepository<Watchlist>
|
|
*/
|
|
class WatchlistRepository extends ServiceEntityRepository
|
|
{
|
|
public function __construct(ManagerRegistry $registry)
|
|
{
|
|
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
|
|
// */
|
|
// public function findByExampleField($value): array
|
|
// {
|
|
// return $this->createQueryBuilder('b')
|
|
// ->andWhere('b.exampleField = :val')
|
|
// ->setParameter('val', $value)
|
|
// ->orderBy('b.id', 'ASC')
|
|
// ->setMaxResults(10)
|
|
// ->getQuery()
|
|
// ->getResult()
|
|
// ;
|
|
// }
|
|
|
|
// public function findOneBySomeField($value): ?Watchlist
|
|
// {
|
|
// return $this->createQueryBuilder('b')
|
|
// ->andWhere('b.exampleField = :val')
|
|
// ->setParameter('val', $value)
|
|
// ->getQuery()
|
|
// ->getOneOrNullResult()
|
|
// ;
|
|
// }
|
|
}
|