34 lines
796 B
PHP
34 lines
796 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Repository;
|
||
|
|
||
|
use App\Entity\Niveau02;
|
||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||
|
use Doctrine\Persistence\ManagerRegistry;
|
||
|
|
||
|
class Niveau02Repository extends ServiceEntityRepository
|
||
|
{
|
||
|
public function __construct(ManagerRegistry $registry)
|
||
|
{
|
||
|
parent::__construct($registry, Niveau02::class);
|
||
|
}
|
||
|
|
||
|
public function add(Niveau02 $entity, bool $flush = false): void
|
||
|
{
|
||
|
$this->getEntityManager()->persist($entity);
|
||
|
|
||
|
if ($flush) {
|
||
|
$this->getEntityManager()->flush();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
public function remove(Niveau02 $entity, bool $flush = false): void
|
||
|
{
|
||
|
$this->getEntityManager()->remove($entity);
|
||
|
|
||
|
if ($flush) {
|
||
|
$this->getEntityManager()->flush();
|
||
|
}
|
||
|
}
|
||
|
}
|