fix loading fixtures for doc generator template

This commit is contained in:
Julien Fastré 2021-12-08 09:52:51 +01:00
parent f206fdb08c
commit 789eeadb40

View File

@ -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();
}
}