mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
45 lines
1.4 KiB
PHP
45 lines
1.4 KiB
PHP
<?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();
|
|
}
|
|
}
|