src/Repository/AboutRepository.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Repository;
  3. use App\Entity\About;
  4. use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
  5. use Doctrine\ORM\OptimisticLockException;
  6. use Doctrine\ORM\ORMException;
  7. use Doctrine\Persistence\ManagerRegistry;
  8. /**
  9.  * @extends ServiceEntityRepository<About>
  10.  *
  11.  * @method About|null find($id, $lockMode = null, $lockVersion = null)
  12.  * @method About|null findOneBy(array $criteria, array $orderBy = null)
  13.  * @method About[]    findAll()
  14.  * @method About[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
  15.  */
  16. class AboutRepository extends ServiceEntityRepository
  17. {
  18.     public function __construct(ManagerRegistry $registry)
  19.     {
  20.         parent::__construct($registry, About::class);
  21.     }
  22.     /**
  23.      * @throws ORMException
  24.      * @throws OptimisticLockException
  25.      */
  26.     public function add(About $entity, bool $flush = true): void
  27.     {
  28.         $this->_em->persist($entity);
  29.         if ($flush) {
  30.             $this->_em->flush();
  31.         }
  32.     }
  33.     /**
  34.      * @throws ORMException
  35.      * @throws OptimisticLockException
  36.      */
  37.     public function remove(About $entity, bool $flush = true): void
  38.     {
  39.         $this->_em->remove($entity);
  40.         if ($flush) {
  41.             $this->_em->flush();
  42.         }
  43.     }
  44.     // /**
  45.     //  * @return About[] Returns an array of About objects
  46.     //  */
  47.     /*
  48.     public function findByExampleField($value)
  49.     {
  50.         return $this->createQueryBuilder('a')
  51.             ->andWhere('a.exampleField = :val')
  52.             ->setParameter('val', $value)
  53.             ->orderBy('a.id', 'ASC')
  54.             ->setMaxResults(10)
  55.             ->getQuery()
  56.             ->getResult()
  57.         ;
  58.     }
  59.     */
  60.     /*
  61.     public function findOneBySomeField($value): ?About
  62.     {
  63.         return $this->createQueryBuilder('a')
  64.             ->andWhere('a.exampleField = :val')
  65.             ->setParameter('val', $value)
  66.             ->getQuery()
  67.             ->getOneOrNullResult()
  68.         ;
  69.     }
  70.     */
  71. }