← Back
Editing: ReportPictureRepository.php
<?php declare(strict_types=1); namespace App\Repository; use App\Entity\ReportPicture; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; /** * @extends ServiceEntityRepository<ReportPicture> * * @method ReportPicture|null find($id, $lockMode = null, $lockVersion = null) * @method ReportPicture|null findOneBy(array $criteria, array $orderBy = null) * @method ReportPicture[] findAll() * @method ReportPicture[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class ReportPictureRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, ReportPicture::class); } public function save(ReportPicture $entity, bool $flush = false): void { $this->getEntityManager()->persist($entity); if ($flush) { $this->getEntityManager()->flush(); } } public function remove(ReportPicture $entity, bool $flush = false): void { $this->getEntityManager()->remove($entity); if ($flush) { $this->getEntityManager()->flush(); } } // /** // * @return ReportPicture[] Returns an array of ReportPicture objects // */ // public function findByExampleField($value): array // { // return $this->createQueryBuilder('w') // ->andWhere('w.exampleField = :val') // ->setParameter('val', $value) // ->orderBy('w.id', 'ASC') // ->setMaxResults(10) // ->getQuery() // ->getResult() // ; // } // public function findOneBySomeField($value): ?ReportPicture // { // return $this->createQueryBuilder('w') // ->andWhere('w.exampleField = :val') // ->setParameter('val', $value) // ->getQuery() // ->getOneOrNullResult() // ; // } }
Save File
Cancel