various improvements on 3party

This commit is contained in:
2021-10-07 17:28:33 +02:00
parent 7ea2c36c5e
commit ca3ced0308
20 changed files with 464 additions and 305 deletions

View File

@@ -1,46 +0,0 @@
<?php
namespace Chill\ThirdPartyBundle\DataFixtures\ORM;
use Chill\ThirdPartyBundle\Entity\ThirdPartyCivility;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
use Doctrine\Persistence\ObjectManager;
/**
* Class LoadThirdPartyCivility
* @package Chill\ThirdPartyBundle\DataFixtures\ORM
* @author Mathieu Jaumotte mathieu.jaumotte@champs-libres.coop
*/
class LoadThirdPartyCivility extends Fixture implements FixtureGroupInterface
{
public static function getGroups(): array
{
return ['thirdparty_civilities'];
}
public function load(ObjectManager $manager): void
{
$civilities = [
['name' => ['fr' => "Monsieur" ]],
['name' => ['fr' => "Madame" ]],
['name' => ['fr' => "Docteur" ]],
['name' => ['fr' => "Professeur" ]],
['name' => ['fr' => "Madame la Directrice" ]],
['name' => ['fr' => "Monsieur le Directeur" ]],
['name' => ['fr' => "Madame la Maire" ]],
['name' => ['fr' => "Monsieur le Maire" ]],
['name' => ['fr' => "Maître" ]],
];
foreach ( $civilities as $val) {
print "Creating thirdparty civility : " . $val['name']['fr'] . "\n";
$civility = (new ThirdPartyCivility())
->setName($val['name'])
->setActive(true);
$manager->persist($civility);
}
$manager->flush();
}
}