suivi/src/Repository/BillVendorRepository.php
2023-04-08 17:47:43 +02:00

67 lines
1.9 KiB
PHP

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