From 789eeadb404c1950f4b33d201bd78bda915664df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julien=20Fastr=C3=A9?= Date: Wed, 8 Dec 2021 09:52:51 +0100 Subject: [PATCH] fix loading fixtures for doc generator template --- .../ORM/LoadDocGeneratorTemplate.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php b/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php index 0db7bbd44..86cedfb3e 100644 --- a/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php +++ b/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php @@ -13,7 +13,8 @@ namespace Chill\DocGeneratorBundle\DataFixtures\ORM; use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate; use Chill\DocStoreBundle\Entity\StoredObject; -use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation; +use Chill\PersonBundle\Entity\AccompanyingPeriod; +use Chill\PersonBundle\Service\DocGenerator\AccompanyingPeriodContext; use DateTime; use Doctrine\Common\DataFixtures\AbstractFixture; use Doctrine\Persistence\ObjectManager; @@ -35,8 +36,9 @@ class LoadDocGeneratorTemplate extends AbstractFixture 'iv' => '[86,231,83,148,117,107,149,173,130,19,105,194,224,145,8,48]', 'type' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', ], - 'context' => 'Chill\DocGeneratorBundle\Context\HouseholdMemberSelectionContext', - 'entities' => [AccompanyingPeriodWorkEvaluation::class], + 'context' => AccompanyingPeriodContext::class, + 'entity' => AccompanyingPeriod::class, + 'options' => ['mainPerson' => false, 'person1' => false, 'person2' => false], ], [ 'name' => ['fr' => 'AIDE ALIMENTAIRE'], 'desc' => 'stocké sur openstack comedienbe', @@ -46,8 +48,9 @@ class LoadDocGeneratorTemplate extends AbstractFixture 'iv' => '[86,231,83,148,117,107,149,173,130,19,105,194,224,145,8,48]', 'type' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', ], - 'context' => 'Chill\DocGeneratorBundle\Context\HouseholdMemberSelectionContext', - 'entities' => ['Chill\PersonBundle\Entity\AccompanyingPeriod', 'Chill\PersonBundle\Entity\SocialWork\SocialAction', AccompanyingPeriodWorkEvaluation::class], + 'context' => AccompanyingPeriodContext::class, + 'entity' => AccompanyingPeriod::class, + 'options' => ['mainPerson' => false, 'person1' => false, 'person2' => false], ], ]; @@ -68,11 +71,11 @@ class LoadDocGeneratorTemplate extends AbstractFixture ->setDescription($template['desc']) ->setFile($newStoredObj) ->setContext($template['context']) - ->setEntities($template['entities']); + ->setEntity($template['entity']) + ->setOptions($template['options']); $manager->persist($newTemplate); - - $manager->flush(); } + $manager->flush(); } }