mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-28 13:06:13 +00:00
LoadGenders fixture access string value of enum
This commit is contained in:
parent
7541238c1e
commit
80940a7b19
@ -23,18 +23,18 @@ class LoadGenders extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
private array $genders = [
|
private array $genders = [
|
||||||
[
|
[
|
||||||
'label' => ['en' => 'man', 'fr' => 'homme'],
|
'label' => ['en' => 'man', 'fr' => 'homme'],
|
||||||
'genderTranslation' => GenderEnum::MALE->value,
|
'genderTranslation' => GenderEnum::MALE,
|
||||||
'icon' => GenderIconEnum::MALE->value,
|
'icon' => GenderIconEnum::MALE,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => ['en' => 'woman', 'fr' => 'femme'],
|
'label' => ['en' => 'woman', 'fr' => 'femme'],
|
||||||
'genderTranslation' => GenderEnum::FEMALE->value,
|
'genderTranslation' => GenderEnum::FEMALE,
|
||||||
'icon' => GenderIconEnum::FEMALE->value,
|
'icon' => GenderIconEnum::FEMALE,
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
'label' => ['en' => 'neutral', 'fr' => 'neutre'],
|
'label' => ['en' => 'neutral', 'fr' => 'neutre'],
|
||||||
'genderTranslation' => GenderEnum::NEUTRAL->value,
|
'genderTranslation' => GenderEnum::NEUTRAL,
|
||||||
'icon' => GenderIconEnum::NEUTRAL->value,
|
'icon' => GenderIconEnum::NEUTRAL,
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ class LoadGenders extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
$new_g->setLabel($g['label']);
|
$new_g->setLabel($g['label']);
|
||||||
$new_g->setIcon($g['icon']);
|
$new_g->setIcon($g['icon']);
|
||||||
|
|
||||||
$this->addReference('g_'.$g['genderTranslation'], $new_g);
|
$this->addReference('g_'.$g['genderTranslation']->value, $new_g);
|
||||||
$manager->persist($new_g);
|
$manager->persist($new_g);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user