mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Fix LoadDocGeneratorTemplate (using docstore obj)
This commit is contained in:
parent
7fe2172f05
commit
a3333c3302
@ -14,7 +14,6 @@ namespace Chill\DocGeneratorBundle\DataFixtures\ORM;
|
|||||||
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
|
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
|
||||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
|
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -28,13 +27,23 @@ class LoadDocGeneratorTemplate extends AbstractFixture
|
|||||||
[
|
[
|
||||||
'name' => ['fr' => 'FORMULAIRE AEB'],
|
'name' => ['fr' => 'FORMULAIRE AEB'],
|
||||||
'desc' => 'stocké sur openstack comedienbe',
|
'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',
|
'context' => 'Chill\DocGeneratorBundle\Context\HouseholdMemberSelectionContext',
|
||||||
'entities' => [AccompanyingPeriodWorkEvaluation::class],
|
'entities' => [AccompanyingPeriodWorkEvaluation::class],
|
||||||
], [
|
], [
|
||||||
'name' => ['fr' => 'AIDE ALIMENTAIRE'],
|
'name' => ['fr' => 'AIDE ALIMENTAIRE'],
|
||||||
'desc' => 'stocké sur openstack comedienbe',
|
'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',
|
'context' => 'Chill\DocGeneratorBundle\Context\HouseholdMemberSelectionContext',
|
||||||
'entities' => ['Chill\PersonBundle\Entity\AccompanyingPeriod', 'Chill\PersonBundle\Entity\SocialWork\SocialAction', AccompanyingPeriodWorkEvaluation::class],
|
'entities' => ['Chill\PersonBundle\Entity\AccompanyingPeriod', 'Chill\PersonBundle\Entity\SocialWork\SocialAction', AccompanyingPeriodWorkEvaluation::class],
|
||||||
],
|
],
|
||||||
@ -43,10 +52,19 @@ class LoadDocGeneratorTemplate extends AbstractFixture
|
|||||||
foreach ($templates as $template) {
|
foreach ($templates as $template) {
|
||||||
echo 'Adding doc generator templates ' . $template['file'] . ")\n";
|
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())
|
$newTemplate = (new DocGeneratorTemplate())
|
||||||
->setName($template['name'])
|
->setName($template['name'])
|
||||||
->setDescription($template['desc'])
|
->setDescription($template['desc'])
|
||||||
->setFile($template['file'])
|
->setFile($newStoredObj)
|
||||||
->setContext($template['context'])
|
->setContext($template['context'])
|
||||||
->setEntities($template['entities']);
|
->setEntities($template['entities']);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user