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

Présuppression des RecallDeclaration

parent 168801f0
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@ use Oscar\Entity\ActivityPerson;
use Oscar\Entity\OrganizationPerson;
use Oscar\Entity\Person;
use Oscar\Entity\ProjectMember;
use Oscar\Entity\RecallDeclaration;
use Oscar\Entity\RecallException;
use Oscar\Entity\TimeSheet;
use Oscar\Exception\OscarDeletePersonNotPossibleException;
@@ -53,6 +54,11 @@ class PersonDeleteService implements UseOscarUserContextService, UseEntityManage
            ->setParameter('person', $person);
        $del->getQuery()->execute();

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

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