src/Repository/ProdViewsRepository.php line 29

Open in your IDE?
  1. <?php
  2. namespace App\Repository;
  3. use App\Entity\ProdViews;
  4. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  5. use Doctrine\Persistence\ManagerRegistry;
  6. /**
  7.  * @extends ServiceEntityRepository<ProdViews>
  8.  *
  9.  * @method ProdViews|null find($id, $lockMode = null, $lockVersion = null)
  10.  * @method ProdViews|null findOneBy(array $criteria, array $orderBy = null)
  11.  * @method ProdViews[]    findAll()
  12.  * @method ProdViews[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  13.  */
  14. class ProdViewsRepository extends ServiceEntityRepository
  15. {
  16.     public function __construct(ManagerRegistry $registry)
  17.     {
  18.         parent::__construct($registryProdViews::class);
  19.     }
  20.     public function add(ProdViews $entitybool $flush false): void
  21.     {
  22.         $this->getEntityManager()->persist($entity);
  23.         if ($flush) {
  24.             $this->getEntityManager()->flush();
  25.         }
  26.     }
  27.     public function remove(ProdViews $entitybool $flush false): void
  28.     {
  29.         $this->getEntityManager()->remove($entity);
  30.         if ($flush) {
  31.             $this->getEntityManager()->flush();
  32.         }
  33.     }
  34. }