src/Entity/UserDetail.php line 10
<?phpnamespace App\Entity;use App\Repository\UserDetailRepository;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: UserDetailRepository::class)]class UserDetail{const GENDER_MALE = "user.gender.male";const GENDER_FEMALE = "user.gender.female";const GENDER_OTHER = "user.gender.other";const STATUS_BACHLOR = "user.status.bachlor";const STATUS_MARRIED = "user.status.married";const STATUS_DIVORCED = "user.status.divorced";const STATUS_WIDOWER = "user.status.widower";#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255, nullable: true)]private ?string $birthdayPlace = null;#[ORM\OneToOne(mappedBy: 'detail', cascade: ['persist', 'remove'])]private ?User $user = null;#[ORM\Column(length: 255, nullable: true)]private ?string $provinceOrigin = null;#[ORM\Column(length: 255, nullable: true)]private ?string $territory = null;#[ORM\Column(length: 255, nullable: true)]private ?string $nationality = null;#[ORM\Column(length: 255, nullable: true)]#[Assert\Choice(callback: [self::class, 'getMaritalStatusList'])]private ?string $maritalStatus = null;#[ORM\Column(length: 255, nullable: true)]private ?string $sector = null;#[ORM\Column(length: 255, nullable: true)]private ?string $groupment = null;#[ORM\Column(length: 255, nullable: true)]private ?string $studyLevel = null;#[ORM\Column(length: 255, nullable: true)]private ?string $studyDomain = null;#[ORM\Column(length: 255, nullable: true)]private ?string $function = null;#[ORM\Column(length: 255, nullable: true)]private ?string $politicalGrouping = null;#[ORM\Column(nullable: true)]private ?\DateTimeImmutable $birthdayAt;#[ORM\Column(length: 255, options: ["default" => self::GENDER_MALE])]#[Assert\Choice(callback: [self::class, 'getGenderList'])]private ?string $gender = self::GENDER_MALE;public static function getGenderList(): array{return [1 => self::GENDER_MALE,2 => self::GENDER_FEMALE,3 => self::GENDER_OTHER,];}public static function getMaritalStatusList(): array{return [1 => self::STATUS_BACHLOR,2 => self::STATUS_MARRIED,3 => self::STATUS_DIVORCED,4 => self::STATUS_WIDOWER,];}public function __construct(){$this->birthdayAt = new \DateTimeImmutable("01-01-2000");}public function getId(): ?int{return $this->id;}public function getBirthdayPlace(): ?string{return $this->birthdayPlace;}public function setBirthdayPlace(?string $birthdayPlace): static{$this->birthdayPlace = $birthdayPlace;return $this;}public function getUser(): ?User{return $this->user;}public function setUser(?User $user): static{// unset the owning side of the relation if necessaryif ($user === null && $this->user !== null) {$this->user->setDetail(null);}// set the owning side of the relation if necessaryif ($user !== null && $user->getDetail() !== $this) {$user->setDetail($this);}$this->user = $user;return $this;}public function getProvinceOrigin(): ?string{return $this->provinceOrigin;}public function setProvinceOrigin(?string $provinceOrigin): static{$this->provinceOrigin = $provinceOrigin;return $this;}public function getTerritory(): ?string{return $this->territory;}public function setTerritory(?string $territory): static{$this->territory = $territory;return $this;}public function getNationality(): ?string{return $this->nationality;}public function setNationality(?string $nationality): static{$this->nationality = $nationality;return $this;}public function getMaritalStatus(): ?string{return $this->maritalStatus;}public function setMaritalStatus(?string $maritalStatus): static{$this->maritalStatus = $maritalStatus;return $this;}public function getSector(): ?string{return $this->sector;}public function setSector(?string $sector): static{$this->sector = $sector;return $this;}public function getGroupment(): ?string{return $this->groupment;}public function setGroupment(string $groupment): static{$this->groupment = $groupment;return $this;}public function getStudyLevel(): ?string{return $this->studyLevel;}public function setStudyLevel(?string $studyLevel): static{$this->studyLevel = $studyLevel;return $this;}public function getStudyDomain(): ?string{return $this->studyDomain;}public function setStudyDomain(?string $studyDomain): static{$this->studyDomain = $studyDomain;return $this;}public function getFunction(): ?string{return $this->function;}public function setFunction(?string $function): static{$this->function = $function;return $this;}public function getPoliticalGrouping(): ?string{return $this->politicalGrouping;}public function setPoliticalGrouping(?string $politicalGrouping): static{$this->politicalGrouping = $politicalGrouping;return $this;}public function getBirthdayAt(): ?\DateTimeImmutable{return $this->birthdayAt;}public function setBirthdayAt(?\DateTimeImmutable $birthdayAt): static{$this->birthdayAt = $birthdayAt;return $this;}public function getGender(): ?string{return $this->gender;}public function setGender(?string $gender): static{$this->gender = $gender;return $this;}}