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