diff --git a/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php b/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php index 082605fd7..293978718 100644 --- a/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php +++ b/src/Bundle/ChillDocGeneratorBundle/DataFixtures/ORM/LoadDocGeneratorTemplate.php @@ -14,7 +14,6 @@ namespace Chill\DocGeneratorBundle\DataFixtures\ORM; use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate; use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation; use Doctrine\Common\DataFixtures\AbstractFixture; - use Doctrine\Persistence\ObjectManager; /** @@ -28,13 +27,23 @@ class LoadDocGeneratorTemplate extends AbstractFixture [ 'name' => ['fr' => 'FORMULAIRE AEB'], 'desc' => 'stocké sur openstack comedienbe', - 'file' => 'FORMULAIRE_AEB_WITH_DATA_INJ.docx', + 'file' => [ + 'filename' => 'mg01Dz3Cn2Erhi1zK8ACN2', + 'key' => '{"alg":"A256CBC","ext":true,"k":"xTd3HIVeFv2Hm7zdkJ4F6XjCO_e-_7Vg9G07s475hX8","key_ops":["encrypt","decrypt"],"kty":"oct"}', + 'iv' => '[178,160,11,24,15,224,208,42,93,171,74,253,78,105,238,136]', + 'type' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' + ], 'context' => 'Chill\DocGeneratorBundle\Context\HouseholdMemberSelectionContext', 'entities' => [AccompanyingPeriodWorkEvaluation::class], ], [ 'name' => ['fr' => 'AIDE ALIMENTAIRE'], 'desc' => 'stocké sur openstack comedienbe', - 'file' => 'AIDE_ALIMENTAIRE.docx', + 'file' => [ + 'filename' => 'pKNlhCrQDCRsAuC8vYHDKa', + 'key' => '{"alg":"A256CBC","ext":true,"k":"_VihnD41-VDHlpS-ouwtbMPnu-OXVdtA7ENQWWtAQYM","key_ops":["encrypt","decrypt"],"kty":"oct"}', + '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], ], @@ -43,10 +52,19 @@ class LoadDocGeneratorTemplate extends AbstractFixture foreach ($templates as $template) { echo 'Adding doc generator templates ' . $template['file'] . ")\n"; + $newStoredObj = (new StoredObject()) + ->setFilename($template['file']['filename']) + ->setKeyInfos(json_decode($template['file']['key'], true)) + ->setIv(json_decode($template['file']['iv'], true)) + ->setCreationDate(new \DateTime('today')) + ->setType($template['file']['type']); + + $manager->persist($newStoredObj); + $newTemplate = (new DocGeneratorTemplate()) ->setName($template['name']) ->setDescription($template['desc']) - ->setFile($template['file']) + ->setFile($newStoredObj) ->setContext($template['context']) ->setEntities($template['entities']);