Household/composition add + fixes household composition editor

This commit is contained in:
2022-01-24 10:59:00 +00:00
parent 2b47868d88
commit 53b3f98bba
35 changed files with 1489 additions and 63 deletions

View File

@@ -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();
}
}