src/Repository/EmailLogRepository.php line 29

Open in your IDE?
  1. <?php
  2. /*
  3.  * This file is part of the Kreno package.
  4.  *
  5.  * (c) Valentin Van Meeuwen <contact@wikub.com>
  6.  *
  7.  * For the full copyright and license information, please view the LICENSE
  8.  * file that was distributed with this source code.
  9.  */
  10. namespace App\Repository;
  11. use App\Entity\EmailLog;
  12. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  13. use Doctrine\ORM\QueryBuilder;
  14. use Doctrine\Persistence\ManagerRegistry;
  15. /**
  16.  * @extends ServiceEntityRepository<EmailLog>
  17.  *
  18.  * @method EmailLog|null find($id, $lockMode = null, $lockVersion = null)
  19.  * @method EmailLog|null findOneBy(array $criteria, array $orderBy = null)
  20.  * @method EmailLog[]    findAll()
  21.  * @method EmailLog[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  22.  */
  23. class EmailLogRepository extends ServiceEntityRepository
  24. {
  25.     public function __construct(ManagerRegistry $registry)
  26.     {
  27.         parent::__construct($registryEmailLog::class);
  28.     }
  29.     public function add(EmailLog $entitybool $flush false): void
  30.     {
  31.         $this->getEntityManager()->persist($entity);
  32.         if ($flush) {
  33.             $this->getEntityManager()->flush();
  34.         }
  35.     }
  36.     public function remove(EmailLog $entitybool $flush false): void
  37.     {
  38.         $this->getEntityManager()->remove($entity);
  39.         if ($flush) {
  40.             $this->getEntityManager()->flush();
  41.         }
  42.     }
  43.     public function getQueryBuilder(): QueryBuilder
  44.     {
  45.         return $this->createQueryBuilder('el')
  46.             ->orderBy('el.sendedAt''DESC')
  47.         ;
  48.     }
  49. //    /**
  50. //     * @return EmailLog[] Returns an array of EmailLog objects
  51. //     */
  52. //    public function findByExampleField($value): array
  53. //    {
  54. //        return $this->createQueryBuilder('e')
  55. //            ->andWhere('e.exampleField = :val')
  56. //            ->setParameter('val', $value)
  57. //            ->orderBy('e.id', 'ASC')
  58. //            ->setMaxResults(10)
  59. //            ->getQuery()
  60. //            ->getResult()
  61. //        ;
  62. //    }
  63. //    public function findOneBySomeField($value): ?EmailLog
  64. //    {
  65. //        return $this->createQueryBuilder('e')
  66. //            ->andWhere('e.exampleField = :val')
  67. //            ->setParameter('val', $value)
  68. //            ->getQuery()
  69. //            ->getOneOrNullResult()
  70. //        ;
  71. //    }
  72. }