mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Datafixtures for Doc Gen
This commit is contained in:
parent
5ce6d37a69
commit
8df4c93c97
@ -0,0 +1,49 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Chill\DocGeneratorBundle\DataFixtures\ORM;
|
||||||
|
|
||||||
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||||
|
use Doctrine\Persistence\ObjectManager;
|
||||||
|
use Doctrine\Common\DataFixtures\DependentFixtureInterface;
|
||||||
|
|
||||||
|
|
||||||
|
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load DocGeneratorTemplate
|
||||||
|
*
|
||||||
|
* @author Champs-Libres Coop
|
||||||
|
*/
|
||||||
|
class LoadDocGeneratorTemplate extends AbstractFixture
|
||||||
|
{
|
||||||
|
|
||||||
|
public function load(ObjectManager $manager)
|
||||||
|
{
|
||||||
|
$templates = [
|
||||||
|
[
|
||||||
|
'name' => ['fr' => 'FORMULAIRE AEB'],
|
||||||
|
'desc' => 'stocké sur openstack comedienbe',
|
||||||
|
'file' => 'FORMULAIRE_AEB.docx'
|
||||||
|
], [
|
||||||
|
'name' => ['fr' => 'AIDE ALIMENTAIRE'],
|
||||||
|
'desc' => 'stocké sur openstack comedienbe',
|
||||||
|
'file' => 'AIDE_ALIMENTAIRE.docx'
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($templates as $template) {
|
||||||
|
|
||||||
|
print('Adding doc generator templates '.$template['file'].")\n");
|
||||||
|
|
||||||
|
$newTemplate = (new DocGeneratorTemplate())
|
||||||
|
->setName($template['name'])
|
||||||
|
->setDescription($template['desc'])
|
||||||
|
->setFile($template['file'])
|
||||||
|
;
|
||||||
|
|
||||||
|
$manager->persist($newTemplate);
|
||||||
|
|
||||||
|
$manager->flush();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user