ChillPersonBundle: add administrativeStatus property to Person

This commit is contained in:
Christophe Siraut
2024-11-27 17:05:50 +01:00
parent 9e3431f397
commit 6c37d798bf
17 changed files with 431 additions and 2 deletions

View File

@@ -0,0 +1,43 @@
<?php
declare(strict_types=1);
/*
* 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.
*/
namespace Chill\PersonBundle\DataFixtures\ORM;
use Chill\PersonBundle\Entity\AdministrativeStatus;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
use Doctrine\Persistence\ObjectManager;
class LoadAdministrativeStatus extends Fixture implements FixtureGroupInterface
{
public static function getGroups(): array
{
return ['administrative_status'];
}
public function load(ObjectManager $manager): void
{
$status = [
['name' => ['fr' => 'situation administrative régulière']],
['name' => ['fr' => 'sans papier']],
['name' => ['fr' => 'séjour provisoire']],
];
foreach ($status as $val) {
$administrativeStatus = (new AdministrativeStatus())
->setName($val['name'])
->setActive(true);
$manager->persist($administrativeStatus);
}
$manager->flush();
}
}