patientRepository = $patientRepository; $this->donCatRepository = $donCatRepository; } public function load(ObjectManager $manager): void { $donneur = $this->patientRepository->findOneBy(['lastname'=>'Durand']); $donCat = $this->donCatRepository->findBy([], ['name'=>'ASC'], 1)[0]; $donneur = (new Don()) ->setCodeBarre('12345678912') ->setDonCat($donCat) ->setNbreTube(5) ->setDonneur($donneur) ; $manager->persist($donneur); $manager->flush(); $donneur = $this->patientRepository->findOneBy(['lastname'=>'Gauthier']); $donCat = $this->donCatRepository->findBy([], ['name'=>'ASC'], 1)[0]; $donneur = (new Don()) ->setCodeBarre('12345678913') ->setDonCat($donCat) ->setNbreTube(6) ->setDonneur($donneur) ; $manager->persist($donneur); $manager->flush(); } public function getDependencies() { return [ DonCatFixtures::class, PatientFixtures::class ]; } }