diff --git a/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php new file mode 100644 index 000000000..5ad32168f --- /dev/null +++ b/src/Bundle/ChillMainBundle/DataFixtures/ORM/LoadLocationType.php @@ -0,0 +1,68 @@ +container = $container; + } + + public function getOrder() { + return 52; + } + + public function load(ObjectManager $manager): void { + + echo "loading some location type... \n"; + + $arr = [ + [ + 'name' => ['fr' => 'Mairie'], + 'address_required' => LocationType::STATUS_OPTIONAL + ], + [ + 'name' => ['fr' => 'Guichet d\'accueil'], + 'address_required' => LocationType::STATUS_OPTIONAL + ], + [ + 'name' => ['fr' => 'Domicile de l\'usager'], + 'address_required' => LocationType::STATUS_REQUIRED + ], + [ + 'name' => ['fr' => 'Centre d\'aide sociale'], + 'address_required' => LocationType::STATUS_OPTIONAL + ], + ]; + + foreach ($arr as $a) { + $locationType = (new LocationType()) + ->setTitle($a['name']) + ->setAvailableForUsers(True) + ->setAddressRequired($a['address_required']); + $manager->persist($locationType); + } + + $manager->flush(); + } +} \ No newline at end of file