<?php
namespace App\Entity;
use App\Repository\UserInfoRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: UserInfoRepository::class)]
class UserInfo
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
#[Groups(['list'])]
private ?int $id;
#[ORM\OneToOne(inversedBy: 'userInfo', targetEntity: User::class)]
#[Groups(['list'])]
private ?User $user;
#[ORM\OneToMany(mappedBy: 'userInfo', targetEntity: UserLanguage::class)]
private $userLanguages;
#[ORM\OneToMany(mappedBy: 'userInfo', targetEntity: UserAddressing::class)]
private $userAdressing;
#[ORM\OneToMany(mappedBy: 'userInfo', targetEntity: UserEmployment::class)]
private $userEmployment;
#[ORM\OneToMany(mappedBy: 'userInfo', targetEntity: UserFamilyInfo::class)]
private $userFamilyInfo;
#[ORM\OneToMany(mappedBy: 'userInfo', targetEntity: UserFile::class)]
private $userFile;
#[ORM\Column(type: 'string', length: 30, nullable: true)]
#[Groups(['list'])]
private ?string $familyName;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Groups(['list'])]
private ?string $lastnameMn;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Groups(['list'])]
private ?string $lastnameEn;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Groups(['list'])]
private ?string $firstnameMn;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Groups(['list'])]
private ?string $firstnameEn;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Groups(['list'])]
private ?string $degree;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Groups(['list'])]
private ?string $title;
#[ORM\Column(type: 'string', length: 20, nullable: true)]
#[Groups(['list'])]
private ?string $regNum;
#[ORM\Column(type: 'string', length: 20, nullable: true)]
#[Groups(['list'])]
private ?string $studentCode;
#[ORM\ManyToOne(targetEntity: Addressing::class)]
#[Groups(['list'])]
private ?Addressing $province;
#[ORM\Column(type: 'smallint', nullable: true)]
#[Groups(['list'])]
private ?int $gender;
#[ORM\ManyToOne(targetEntity: GlobalConstant::class)]
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
#[Groups(['list'])]
private ?GlobalConstant $nationality;
#[ORM\ManyToOne(targetEntity: Country::class)]
#[Groups(['list'])]
private $country;
#[ORM\Column(type: 'date', nullable: true)]
#[Assert\Type('DateTimeInterface')]
#[Groups(['list'])]
private ?\DateTimeInterface $birthDate;
#[ORM\Column(type: 'string', length: 20, nullable: true)]
#[Groups(['list'])]
private ?string $mobile;
#[ORM\Column(type: 'string', length: 30, nullable: true)]
#[Groups(['list'])]
private ?string $phoneHome;
#[ORM\Column(type: 'string', length: 30, nullable: true)]
#[Groups(['list'])]
private ?string $phoneWork;
#[ORM\Column(type: 'string', length: 30, nullable: true)]
#[Groups(['list'])]
private ?string $ethnicity;
#[ORM\ManyToOne(targetEntity: UserEducation::class)]
#[Groups(['list'])]
private ?UserEducation $userEducation;
#[ORM\ManyToOne(targetEntity: UserAddressing::class)]
#[Groups(['list'])]
private ?UserAddressing $userAddressingMain;
#[ORM\ManyToOne(targetEntity: UserAddressing::class)]
#[Groups(['list'])]
private ?UserAddressing $userAddressingCurrent;
#[ORM\OneToOne(mappedBy: 'userInfo', targetEntity: UserDisability::class)]
private ?UserDisability $userDisability;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Groups(['list'])]
private ?string $university;
#[ORM\Column(type: 'string', length: 50, nullable: true)]
#[Groups(['list'])]
private ?string $academicField;
#[ORM\Column(type: 'smallint', length: 2, nullable: true)]
#[Groups(['list'])]
private $course;
#[ORM\Column(type: 'string', length: 20, nullable: true)]
#[Groups(['list'])]
private ?string $mobile_2;
public function __construct()
{
$this->userLanguages = new ArrayCollection();
$this->userAdressing = new ArrayCollection();
$this->userEmployment = new ArrayCollection();
$this->userFamilyInfo = new ArrayCollection();
$this->userFile = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getFamilyName(): ?string
{
return $this->familyName;
}
public function setFamilyName(string $familyName): self
{
$this->familyName = $familyName;
return $this;
}
public function getLastnameMn(): ?string
{
return $this->lastnameMn;
}
public function setLastnameMn(string $lastnameMn): self
{
$this->lastnameMn = $lastnameMn;
return $this;
}
public function getLastnameEn(): ?string
{
return $this->lastnameEn;
}
public function setLastnameEn(string $lastnameEn): self
{
$this->lastnameEn = $lastnameEn;
return $this;
}
public function getFirstnameMn(): ?string
{
return $this->firstnameMn;
}
public function setFirstnameMn(string $firstnameMn): self
{
$this->firstnameMn = $firstnameMn;
return $this;
}
public function getFirstnameEn(): ?string
{
return $this->firstnameEn;
}
public function setFirstnameEn(string $firstnameEn): self
{
$this->firstnameEn = $firstnameEn;
return $this;
}
public function getRegNum(): ?string
{
return $this->regNum;
}
public function setRegNum(string $regNum): self
{
$this->regNum = $regNum;
return $this;
}
public function getStudentCode(): ?string
{
return $this->studentCode;
}
public function setStudentCode(string $studentCode): self
{
$this->studentCode = $studentCode;
return $this;
}
public function getGender(): ?int
{
return $this->gender;
}
public function setGender(int $gender): self
{
$this->gender = $gender;
return $this;
}
public function getBirthDate(): ?\DateTimeInterface
{
return $this->birthDate;
}
public function setBirthDate(\DateTimeInterface $birthDate): self
{
$this->birthDate = $birthDate;
return $this;
}
public function getMobile(): ?string
{
return $this->mobile;
}
public function setMobile(string $mobile): self
{
$this->mobile = $mobile;
return $this;
}
public function getPhoneHome(): ?string
{
return $this->phoneHome;
}
public function setPhoneHome(string $phoneHome): self
{
$this->phoneHome = $phoneHome;
return $this;
}
public function getPhoneWork(): ?string
{
return $this->phoneWork;
}
public function setPhoneWork(string $phoneWork): self
{
$this->phoneWork = $phoneWork;
return $this;
}
public function getUserEducation(): ?UserEducation
{
return $this->userEducation;
}
public function setUserEducation(?UserEducation $userEducation): self
{
$this->userEducation = $userEducation;
return $this;
}
public function getUserAddressingMain(): ?UserAddressing
{
return $this->userAddressingMain;
}
public function setUserAddressingMain(?UserAddressing $userAddressingMain): self
{
$this->userAddressingMain = $userAddressingMain;
return $this;
}
public function getUserAddressingCurrent(): ?UserAddressing
{
return $this->userAddressingCurrent;
}
public function setUserAddressingCurrent(?UserAddressing $userAddressingCurrent): self
{
$this->userAddressingCurrent = $userAddressingCurrent;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getNationality(): ?GlobalConstant
{
return $this->nationality;
}
public function setNationality(?GlobalConstant $nationality): self
{
$this->nationality = $nationality;
return $this;
}
public function getProvince(): ?Addressing
{
return $this->province;
}
public function setProvince(?Addressing $province): self
{
$this->province = $province;
return $this;
}
public function getEthnicity(): ?string
{
return $this->ethnicity;
}
public function setEthnicity(?string $ethnicity): self
{
$this->ethnicity = $ethnicity;
return $this;
}
public function getUserDisability(): ?UserDisability
{
return $this->userDisability;
}
public function setUserDisability(?UserDisability $userDisability): self
{
// unset the owning side of the relation if necessary
if ($userDisability === null && $this->userDisability !== null) {
$this->userDisability->setUserInfo(null);
}
// set the owning side of the relation if necessary
if ($userDisability !== null && $userDisability->getUserInfo() !== $this) {
$userDisability->setUserInfo($this);
}
$this->userDisability = $userDisability;
return $this;
}
public function getCountry(): ?Country
{
return $this->country;
}
public function setCountry(?Country $country): self
{
$this->country = $country;
return $this;
}
/**
* @return Collection<int, UserLanguage>
*/
public function getUserLanguages(): Collection
{
return $this->userLanguages;
}
public function addUserLanguage(UserLanguage $userLanguage): self
{
if (!$this->userLanguages->contains($userLanguage)) {
$this->userLanguages->add($userLanguage);
$userLanguage->setUserInfo($this);
}
return $this;
}
public function removeUserLanguage(UserLanguage $userLanguage): self
{
if ($this->userLanguages->removeElement($userLanguage)) {
// set the owning side to null (unless already changed)
if ($userLanguage->getUserInfo() === $this) {
$userLanguage->setUserInfo(null);
}
}
return $this;
}
/**
* @return Collection<int, UserAddressing>
*/
public function getUserAdressing(): Collection
{
return $this->userAdressing;
}
public function addUserAdressing(UserAddressing $userAdressing): self
{
if (!$this->userAdressing->contains($userAdressing)) {
$this->userAdressing->add($userAdressing);
$userAdressing->setUserInfo($this);
}
return $this;
}
public function removeUserAdressing(UserAddressing $userAdressing): self
{
if ($this->userAdressing->removeElement($userAdressing)) {
// set the owning side to null (unless already changed)
if ($userAdressing->getUserInfo() === $this) {
$userAdressing->setUserInfo(null);
}
}
return $this;
}
/**
* @return Collection<int, UserEmployment>
*/
public function getUserEmployment(): Collection
{
return $this->userEmployment;
}
public function addUserEmployment(UserEmployment $userEmployment): self
{
if (!$this->userEmployment->contains($userEmployment)) {
$this->userEmployment->add($userEmployment);
$userEmployment->setUserInfo($this);
}
return $this;
}
public function removeUserEmployment(UserEmployment $userEmployment): self
{
if ($this->userEmployment->removeElement($userEmployment)) {
// set the owning side to null (unless already changed)
if ($userEmployment->getUserInfo() === $this) {
$userEmployment->setUserInfo(null);
}
}
return $this;
}
/**
* @return Collection<int, UserFamilyInfo>
*/
public function getUserFamilyInfo(): Collection
{
return $this->userFamilyInfo;
}
public function addUserFamilyInfo(UserFamilyInfo $userFamilyInfo): self
{
if (!$this->userFamilyInfo->contains($userFamilyInfo)) {
$this->userFamilyInfo->add($userFamilyInfo);
$userFamilyInfo->setUserInfo($this);
}
return $this;
}
public function removeUserFamilyInfo(UserFamilyInfo $userFamilyInfo): self
{
if ($this->userFamilyInfo->removeElement($userFamilyInfo)) {
// set the owning side to null (unless already changed)
if ($userFamilyInfo->getUserInfo() === $this) {
$userFamilyInfo->setUserInfo(null);
}
}
return $this;
}
/**
* @return Collection<int, UserFile>
*/
public function getUserFile(): Collection
{
return $this->userFile;
}
public function addUserFile(UserFile $userFile): self
{
if (!$this->userFile->contains($userFile)) {
$this->userFile->add($userFile);
$userFile->setUserInfo($this);
}
return $this;
}
public function removeUserFile(UserFile $userFile): self
{
if ($this->userFile->removeElement($userFile)) {
// set the owning side to null (unless already changed)
if ($userFile->getUserInfo() === $this) {
$userFile->setUserInfo(null);
}
}
return $this;
}
public function getDegree(): ?string
{
return $this->degree;
}
public function setDegree(?string $degree): self
{
$this->degree = $degree;
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getUniversity(): ?string
{
return $this->university;
}
public function setUniversity(?string $university): void
{
$this->university = $university;
}
public function getAcademicField(): ?string
{
return $this->academicField;
}
public function setAcademicField(?string $academicField): void
{
$this->academicField = $academicField;
}
public function getCourse(): ?string
{
return $this->course;
}
public function setCourse(?int $course): void
{
$this->course = $course;
}
public function getMobile2(): ?string
{
return $this->mobile_2;
}
public function setMobile2(?string $mobile_2): void
{
$this->mobile_2 = $mobile_2;
}
}