mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Household/composition add + fixes household composition editor
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\PersonBundle\DataFixtures\ORM;
|
||||
|
||||
use Chill\PersonBundle\Entity\Household\HouseholdCompositionType;
|
||||
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
class LoadHouseholdCompositionType extends AbstractFixture implements FixtureGroupInterface
|
||||
{
|
||||
public const TYPES = [
|
||||
['fr' => 'Couple avec enfant(s)'],
|
||||
['fr' => 'Couple sans enfant'],
|
||||
['fr' => 'Mère seule'],
|
||||
['fr' => 'Père seul'],
|
||||
['fr' => 'Mère isolée'],
|
||||
['fr' => 'Père isolé'],
|
||||
['fr' => 'Homme seul'],
|
||||
['fr' => 'Femme seule'],
|
||||
];
|
||||
|
||||
public static function getGroups(): array
|
||||
{
|
||||
return ['composition-type'];
|
||||
}
|
||||
|
||||
public function load(ObjectManager $manager)
|
||||
{
|
||||
foreach (self::TYPES as $type) {
|
||||
$manager->persist(
|
||||
(new HouseholdCompositionType())
|
||||
->setLabel($type)
|
||||
);
|
||||
}
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user