/
vladislavts
/
gcppmsp
Обзор
Документация
Войти
/
vladislavts
/
gcppmsp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
prod
src/Repository/ImageGalleryRepository.php
66 строк
2 KB
Vladislav
check
22 окт 2022, 14:44
22 окт 2022, 14:44
72a77a6
Код
Авторство
О чём код?
<?php namespace App\Repository; use App\Entity\ImageGallery; use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; use Doctrine\Persistence\ManagerRegistry; /** * @extends ServiceEntityRepository<ImageGallery> * * @method ImageGallery|null find($id, $lockMode = null, $lockVersion = null) * @method ImageGallery|null findOneBy(array $criteria, array $orderBy = null) * @method ImageGallery[] findAll() * @method ImageGallery[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) */ class ImageGalleryRepository extends ServiceEntityRepository { public function __construct(ManagerRegistry $registry) { parent::__construct($registry, ImageGallery::class); } public function add(ImageGallery $entity, bool $flush = false): void { $this->getEntityManager()->persist($entity); if ($flush) { $this->getEntityManager()->flush(); } } public function remove(ImageGallery $entity, bool $flush = false): void { $this->getEntityManager()->remove($entity); if ($flush) { $this->getEntityManager()->flush(); } } // /** // * @return ImageGallery[] Returns an array of ImageGallery objects // */ // public function findByExampleField($value): array // { // return $this->createQueryBuilder('i') // ->andWhere('i.exampleField = :val') // ->setParameter('val', $value) // ->orderBy('i.id', 'ASC') // ->setMaxResults(10) // ->getQuery() // ->getResult() // ; // } // public function findOneBySomeField($value): ?ImageGallery // { // return $this->createQueryBuilder('i') // ->andWhere('i.exampleField = :val') // ->setParameter('val', $value) // ->getQuery() // ->getOneOrNullResult() // ; // } }