mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
adding fixtures for new thirdparty fields (choice lists)
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\ThirdPartyBundle\DataFixtures\ORM;
|
||||
|
||||
use Chill\ThirdPartyBundle\Entity\ThirdPartyProfession;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
/**
|
||||
* Class LoadThirdPartyProfession
|
||||
* @package Chill\ThirdPartyBundle\DataFixtures\ORM
|
||||
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
|
||||
*/
|
||||
class LoadThirdPartyProfession extends Fixture implements FixtureGroupInterface
|
||||
{
|
||||
public static function getGroups(): array
|
||||
{
|
||||
return ['thirdparty_professions'];
|
||||
}
|
||||
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
$professions = [
|
||||
['name' => ['fr' => "Directeur" ]],
|
||||
['name' => ['fr' => "Docteur" ]],
|
||||
['name' => ['fr' => "Médecin" ]],
|
||||
['name' => ['fr' => "Opérateur" ]],
|
||||
['name' => ['fr' => "Personnel administratif" ]],
|
||||
['name' => ['fr' => "Président" ]],
|
||||
['name' => ['fr' => "Responsable infirmier.ère" ]],
|
||||
];
|
||||
|
||||
foreach ( $professions as $val) {
|
||||
print "Creating thirdparty professions : " . $val['name']['fr'] . "\n";
|
||||
$profession = (new ThirdPartyProfession())
|
||||
->setName($val['name'])
|
||||
->setActive(true);
|
||||
$manager->persist($profession);
|
||||
}
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user