mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 14:43:49 +00:00
Create genderEnum, add genderTranslation property to Gender entity and new gender property to Person entity
Also migrations were created to handle the changes in the database.
This commit is contained in:
@@ -25,9 +25,9 @@ class Gender
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $active = true;
|
||||
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::BOOLEAN)]
|
||||
private bool $isGrammatical = true;
|
||||
#[Assert\NotNull(message: 'You must choose a gender translation')]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, enumType: GenderEnum::class)]
|
||||
private GenderEnum $genderTranslation;
|
||||
|
||||
#[Serializer\Groups(['read'])]
|
||||
#[ORM\Column(type: \Doctrine\DBAL\Types\Types::STRING, length: 255)]
|
||||
@@ -61,14 +61,14 @@ class Gender
|
||||
$this->active = $active;
|
||||
}
|
||||
|
||||
public function isGrammatical(): bool
|
||||
public function getGenderTranslation(): GenderEnum
|
||||
{
|
||||
return $this->isGrammatical;
|
||||
return $this->genderTranslation;
|
||||
}
|
||||
|
||||
public function setIsGrammatical(bool $isGrammatical): void
|
||||
public function setGenderTranslation(GenderEnum $genderTranslation): void
|
||||
{
|
||||
$this->isGrammatical = $isGrammatical;
|
||||
$this->$genderTranslation = $genderTranslation;
|
||||
}
|
||||
|
||||
public function getIcon(): string
|
||||
|
11
src/Bundle/ChillMainBundle/Entity/GenderEnum.php
Normal file
11
src/Bundle/ChillMainBundle/Entity/GenderEnum.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Chill\MainBundle\Entity;
|
||||
|
||||
enum GenderEnum : string
|
||||
{
|
||||
case MALE = 'man';
|
||||
case FEMALE = 'woman';
|
||||
case NEUTRAL = 'neutral';
|
||||
case UNKNOWN = 'unknown';
|
||||
}
|
Reference in New Issue
Block a user