Commit ded79a6d authored by Jean-Baptiste Oellers's avatar Jean-Baptiste Oellers
Browse files

Présuppression des WorkPackagePerson

parent ea23088d
Loading
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -10,6 +10,7 @@ use Oscar\Entity\RecallDeclaration;
use Oscar\Entity\RecallException;
use Oscar\Entity\Referent;
use Oscar\Entity\TimeSheet;
use Oscar\Entity\WorkPackagePerson;
use Oscar\Exception\OscarDeletePersonNotPossibleException;
use Oscar\Exception\OscarException;
use Oscar\Provider\Privileges;
@@ -70,6 +71,11 @@ class PersonDeleteService implements UseOscarUserContextService, UseEntityManage
            ->setParameter('person', $person);
        $del->getQuery()->execute();

        $del = $this->getEntityManager()->createQueryBuilder()->delete(WorkPackagePerson::class, 'n')
            ->where('n.person = :person')
            ->setParameter('person', $person);
        $del->getQuery()->execute();

        $this->getEntityManager()->remove($person);
        $this->getEntityManager()->flush();
    }