src/Entity/UserInfo.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserInfoRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use Symfony\Component\Validator\Constraints as Assert;
  10. #[ORM\Entity(repositoryClassUserInfoRepository::class)]
  11. class UserInfo
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     #[Groups(['list'])]
  17.     private ?int $id;
  18.     #[ORM\OneToOne(inversedBy'userInfo'targetEntityUser::class)]
  19.     #[Groups(['list'])]
  20.     private ?User $user;
  21.     #[ORM\OneToMany(mappedBy'userInfo'targetEntityUserLanguage::class)]
  22.     private $userLanguages;
  23.     #[ORM\OneToMany(mappedBy'userInfo'targetEntityUserAddressing::class)]
  24.     private $userAdressing;
  25.     #[ORM\OneToMany(mappedBy'userInfo'targetEntityUserEmployment::class)]
  26.     private $userEmployment;
  27.     #[ORM\OneToMany(mappedBy'userInfo'targetEntityUserFamilyInfo::class)]
  28.     private $userFamilyInfo;
  29.     #[ORM\OneToMany(mappedBy'userInfo'targetEntityUserFile::class)]
  30.     private $userFile;
  31.     #[ORM\Column(type'string'length30nullabletrue)]
  32.     #[Groups(['list'])]
  33.     private ?string $familyName;
  34.     #[ORM\Column(type'string'length50nullabletrue)]
  35.     #[Groups(['list'])]
  36.     private ?string $lastnameMn;
  37.     #[ORM\Column(type'string'length50nullabletrue)]
  38.     #[Groups(['list'])]
  39.     private ?string $lastnameEn;
  40.     #[ORM\Column(type'string'length50nullabletrue)]
  41.     #[Groups(['list'])]
  42.     private ?string $firstnameMn;
  43.     #[ORM\Column(type'string'length50nullabletrue)]
  44.     #[Groups(['list'])]
  45.     private ?string $firstnameEn;
  46.     #[ORM\Column(type'string'length50nullabletrue)]
  47.     #[Groups(['list'])]
  48.     private ?string $degree;
  49.     #[ORM\Column(type'string'length50nullabletrue)]
  50.     #[Groups(['list'])]
  51.     private ?string $title;
  52.     #[ORM\Column(type'string'length20nullabletrue)]
  53.     #[Groups(['list'])]
  54.     private ?string $regNum;
  55.     #[ORM\Column(type'string'length20nullabletrue)]
  56.     #[Groups(['list'])]
  57.     private ?string $studentCode;
  58.     #[ORM\ManyToOne(targetEntityAddressing::class)]
  59.     #[Groups(['list'])]
  60.     private ?Addressing $province;
  61.     #[ORM\Column(type'smallint'nullabletrue)]
  62.     #[Groups(['list'])]
  63.     private ?int $gender;
  64.     #[ORM\ManyToOne(targetEntityGlobalConstant::class)]
  65.     #[ORM\JoinColumn(nullabletrueonDelete'SET NULL')]
  66.     #[Groups(['list'])]
  67.     private ?GlobalConstant $nationality;
  68.     #[ORM\ManyToOne(targetEntityCountry::class)]
  69.     #[Groups(['list'])]
  70.     private $country;
  71.     #[ORM\Column(type'date'nullabletrue)]
  72.     #[Assert\Type('DateTimeInterface')]
  73.     #[Groups(['list'])]
  74.     private ?\DateTimeInterface $birthDate;
  75.     #[ORM\Column(type'string'length20nullabletrue)]
  76.     #[Groups(['list'])]
  77.     private ?string $mobile;
  78.     #[ORM\Column(type'string'length30nullabletrue)]
  79.     #[Groups(['list'])]
  80.     private ?string $phoneHome;
  81.     #[ORM\Column(type'string'length30nullabletrue)]
  82.     #[Groups(['list'])]
  83.     private ?string $phoneWork;
  84.     #[ORM\Column(type'string'length30nullabletrue)]
  85.     #[Groups(['list'])]
  86.     private ?string $ethnicity;
  87.     #[ORM\ManyToOne(targetEntityUserEducation::class)]
  88.     #[Groups(['list'])]
  89.     private ?UserEducation $userEducation;
  90.     #[ORM\ManyToOne(targetEntityUserAddressing::class)]
  91.     #[Groups(['list'])]
  92.     private ?UserAddressing $userAddressingMain;
  93.     #[ORM\ManyToOne(targetEntityUserAddressing::class)]
  94.     #[Groups(['list'])]
  95.     private ?UserAddressing $userAddressingCurrent;
  96.     #[ORM\OneToOne(mappedBy'userInfo'targetEntityUserDisability::class)]
  97.     private ?UserDisability $userDisability;
  98.     #[ORM\Column(type'string'length50nullabletrue)]
  99.     #[Groups(['list'])]
  100.     private ?string $university;
  101.     #[ORM\Column(type'string'length50nullabletrue)]
  102.     #[Groups(['list'])]
  103.     private ?string $academicField;
  104.     #[ORM\Column(type'smallint'length2nullabletrue)]
  105.     #[Groups(['list'])]
  106.     private $course;
  107.     #[ORM\Column(type'string'length20nullabletrue)]
  108.     #[Groups(['list'])]
  109.     private ?string $mobile_2;
  110.     public function __construct()
  111.     {
  112.         $this->userLanguages = new ArrayCollection();
  113.         $this->userAdressing = new ArrayCollection();
  114.         $this->userEmployment = new ArrayCollection();
  115.         $this->userFamilyInfo = new ArrayCollection();
  116.         $this->userFile = new ArrayCollection();
  117.     }
  118.     public function getId(): ?int
  119.     {
  120.         return $this->id;
  121.     }
  122.     public function getFamilyName(): ?string
  123.     {
  124.         return $this->familyName;
  125.     }
  126.     public function setFamilyName(string $familyName): self
  127.     {
  128.         $this->familyName $familyName;
  129.         return $this;
  130.     }
  131.     public function getLastnameMn(): ?string
  132.     {
  133.         return $this->lastnameMn;
  134.     }
  135.     public function setLastnameMn(string $lastnameMn): self
  136.     {
  137.         $this->lastnameMn $lastnameMn;
  138.         return $this;
  139.     }
  140.     public function getLastnameEn(): ?string
  141.     {
  142.         return $this->lastnameEn;
  143.     }
  144.     public function setLastnameEn(string $lastnameEn): self
  145.     {
  146.         $this->lastnameEn $lastnameEn;
  147.         return $this;
  148.     }
  149.     public function getFirstnameMn(): ?string
  150.     {
  151.         return $this->firstnameMn;
  152.     }
  153.     public function setFirstnameMn(string $firstnameMn): self
  154.     {
  155.         $this->firstnameMn $firstnameMn;
  156.         return $this;
  157.     }
  158.     public function getFirstnameEn(): ?string
  159.     {
  160.         return $this->firstnameEn;
  161.     }
  162.     public function setFirstnameEn(string $firstnameEn): self
  163.     {
  164.         $this->firstnameEn $firstnameEn;
  165.         return $this;
  166.     }
  167.     public function getRegNum(): ?string
  168.     {
  169.         return $this->regNum;
  170.     }
  171.     public function setRegNum(string $regNum): self
  172.     {
  173.         $this->regNum $regNum;
  174.         return $this;
  175.     }
  176.     public function getStudentCode(): ?string
  177.     {
  178.         return $this->studentCode;
  179.     }
  180.     public function setStudentCode(string $studentCode): self
  181.     {
  182.         $this->studentCode $studentCode;
  183.         return $this;
  184.     }
  185.     public function getGender(): ?int
  186.     {
  187.         return $this->gender;
  188.     }
  189.     public function setGender(int $gender): self
  190.     {
  191.         $this->gender $gender;
  192.         return $this;
  193.     }
  194.     public function getBirthDate(): ?\DateTimeInterface
  195.     {
  196.         return $this->birthDate;
  197.     }
  198.     public function setBirthDate(\DateTimeInterface $birthDate): self
  199.     {
  200.         $this->birthDate $birthDate;
  201.         return $this;
  202.     }
  203.     public function getMobile(): ?string
  204.     {
  205.         return $this->mobile;
  206.     }
  207.     public function setMobile(string $mobile): self
  208.     {
  209.         $this->mobile $mobile;
  210.         return $this;
  211.     }
  212.     public function getPhoneHome(): ?string
  213.     {
  214.         return $this->phoneHome;
  215.     }
  216.     public function setPhoneHome(string $phoneHome): self
  217.     {
  218.         $this->phoneHome $phoneHome;
  219.         return $this;
  220.     }
  221.     public function getPhoneWork(): ?string
  222.     {
  223.         return $this->phoneWork;
  224.     }
  225.     public function setPhoneWork(string $phoneWork): self
  226.     {
  227.         $this->phoneWork $phoneWork;
  228.         return $this;
  229.     }
  230.     public function getUserEducation(): ?UserEducation
  231.     {
  232.         return $this->userEducation;
  233.     }
  234.     public function setUserEducation(?UserEducation $userEducation): self
  235.     {
  236.         $this->userEducation $userEducation;
  237.         return $this;
  238.     }
  239.     public function getUserAddressingMain(): ?UserAddressing
  240.     {
  241.         return $this->userAddressingMain;
  242.     }
  243.     public function setUserAddressingMain(?UserAddressing $userAddressingMain): self
  244.     {
  245.         $this->userAddressingMain $userAddressingMain;
  246.         return $this;
  247.     }
  248.     public function getUserAddressingCurrent(): ?UserAddressing
  249.     {
  250.         return $this->userAddressingCurrent;
  251.     }
  252.     public function setUserAddressingCurrent(?UserAddressing $userAddressingCurrent): self
  253.     {
  254.         $this->userAddressingCurrent $userAddressingCurrent;
  255.         return $this;
  256.     }
  257.     public function getUser(): ?User
  258.     {
  259.         return $this->user;
  260.     }
  261.     public function setUser(?User $user): self
  262.     {
  263.         $this->user $user;
  264.         return $this;
  265.     }
  266.     public function getNationality(): ?GlobalConstant
  267.     {
  268.         return $this->nationality;
  269.     }
  270.     public function setNationality(?GlobalConstant $nationality): self
  271.     {
  272.         $this->nationality $nationality;
  273.         return $this;
  274.     }
  275.     public function getProvince(): ?Addressing
  276.     {
  277.         return $this->province;
  278.     }
  279.     public function setProvince(?Addressing $province): self
  280.     {
  281.         $this->province $province;
  282.         return $this;
  283.     }
  284.     public function getEthnicity(): ?string
  285.     {
  286.         return $this->ethnicity;
  287.     }
  288.     public function setEthnicity(?string $ethnicity): self
  289.     {
  290.         $this->ethnicity $ethnicity;
  291.         return $this;
  292.     }
  293.     public function getUserDisability(): ?UserDisability
  294.     {
  295.         return $this->userDisability;
  296.     }
  297.     public function setUserDisability(?UserDisability $userDisability): self
  298.     {
  299.         // unset the owning side of the relation if necessary
  300.         if ($userDisability === null && $this->userDisability !== null) {
  301.             $this->userDisability->setUserInfo(null);
  302.         }
  303.         // set the owning side of the relation if necessary
  304.         if ($userDisability !== null && $userDisability->getUserInfo() !== $this) {
  305.             $userDisability->setUserInfo($this);
  306.         }
  307.         $this->userDisability $userDisability;
  308.         return $this;
  309.     }
  310.     public function getCountry(): ?Country
  311.     {
  312.         return $this->country;
  313.     }
  314.     public function setCountry(?Country $country): self
  315.     {
  316.         $this->country $country;
  317.         return $this;
  318.     }
  319.     /**
  320.      * @return Collection<int, UserLanguage>
  321.      */
  322.     public function getUserLanguages(): Collection
  323.     {
  324.         return $this->userLanguages;
  325.     }
  326.     public function addUserLanguage(UserLanguage $userLanguage): self
  327.     {
  328.         if (!$this->userLanguages->contains($userLanguage)) {
  329.             $this->userLanguages->add($userLanguage);
  330.             $userLanguage->setUserInfo($this);
  331.         }
  332.         return $this;
  333.     }
  334.     public function removeUserLanguage(UserLanguage $userLanguage): self
  335.     {
  336.         if ($this->userLanguages->removeElement($userLanguage)) {
  337.             // set the owning side to null (unless already changed)
  338.             if ($userLanguage->getUserInfo() === $this) {
  339.                 $userLanguage->setUserInfo(null);
  340.             }
  341.         }
  342.         return $this;
  343.     }
  344.     /**
  345.      * @return Collection<int, UserAddressing>
  346.      */
  347.     public function getUserAdressing(): Collection
  348.     {
  349.         return $this->userAdressing;
  350.     }
  351.     public function addUserAdressing(UserAddressing $userAdressing): self
  352.     {
  353.         if (!$this->userAdressing->contains($userAdressing)) {
  354.             $this->userAdressing->add($userAdressing);
  355.             $userAdressing->setUserInfo($this);
  356.         }
  357.         return $this;
  358.     }
  359.     public function removeUserAdressing(UserAddressing $userAdressing): self
  360.     {
  361.         if ($this->userAdressing->removeElement($userAdressing)) {
  362.             // set the owning side to null (unless already changed)
  363.             if ($userAdressing->getUserInfo() === $this) {
  364.                 $userAdressing->setUserInfo(null);
  365.             }
  366.         }
  367.         return $this;
  368.     }
  369.     /**
  370.      * @return Collection<int, UserEmployment>
  371.      */
  372.     public function getUserEmployment(): Collection
  373.     {
  374.         return $this->userEmployment;
  375.     }
  376.     public function addUserEmployment(UserEmployment $userEmployment): self
  377.     {
  378.         if (!$this->userEmployment->contains($userEmployment)) {
  379.             $this->userEmployment->add($userEmployment);
  380.             $userEmployment->setUserInfo($this);
  381.         }
  382.         return $this;
  383.     }
  384.     public function removeUserEmployment(UserEmployment $userEmployment): self
  385.     {
  386.         if ($this->userEmployment->removeElement($userEmployment)) {
  387.             // set the owning side to null (unless already changed)
  388.             if ($userEmployment->getUserInfo() === $this) {
  389.                 $userEmployment->setUserInfo(null);
  390.             }
  391.         }
  392.         return $this;
  393.     }
  394.     /**
  395.      * @return Collection<int, UserFamilyInfo>
  396.      */
  397.     public function getUserFamilyInfo(): Collection
  398.     {
  399.         return $this->userFamilyInfo;
  400.     }
  401.     public function addUserFamilyInfo(UserFamilyInfo $userFamilyInfo): self
  402.     {
  403.         if (!$this->userFamilyInfo->contains($userFamilyInfo)) {
  404.             $this->userFamilyInfo->add($userFamilyInfo);
  405.             $userFamilyInfo->setUserInfo($this);
  406.         }
  407.         return $this;
  408.     }
  409.     public function removeUserFamilyInfo(UserFamilyInfo $userFamilyInfo): self
  410.     {
  411.         if ($this->userFamilyInfo->removeElement($userFamilyInfo)) {
  412.             // set the owning side to null (unless already changed)
  413.             if ($userFamilyInfo->getUserInfo() === $this) {
  414.                 $userFamilyInfo->setUserInfo(null);
  415.             }
  416.         }
  417.         return $this;
  418.     }
  419.     /**
  420.      * @return Collection<int, UserFile>
  421.      */
  422.     public function getUserFile(): Collection
  423.     {
  424.         return $this->userFile;
  425.     }
  426.     public function addUserFile(UserFile $userFile): self
  427.     {
  428.         if (!$this->userFile->contains($userFile)) {
  429.             $this->userFile->add($userFile);
  430.             $userFile->setUserInfo($this);
  431.         }
  432.         return $this;
  433.     }
  434.     public function removeUserFile(UserFile $userFile): self
  435.     {
  436.         if ($this->userFile->removeElement($userFile)) {
  437.             // set the owning side to null (unless already changed)
  438.             if ($userFile->getUserInfo() === $this) {
  439.                 $userFile->setUserInfo(null);
  440.             }
  441.         }
  442.         return $this;
  443.     }
  444.     public function getDegree(): ?string
  445.     {
  446.         return $this->degree;
  447.     }
  448.     public function setDegree(?string $degree): self
  449.     {
  450.         $this->degree $degree;
  451.         return $this;
  452.     }
  453.     public function getTitle(): ?string
  454.     {
  455.         return $this->title;
  456.     }
  457.     public function setTitle(?string $title): self
  458.     {
  459.         $this->title $title;
  460.         return $this;
  461.     }
  462.     public function getUniversity(): ?string
  463.     {
  464.         return $this->university;
  465.     }
  466.     public function setUniversity(?string $university): void
  467.     {
  468.         $this->university $university;
  469.     }
  470.     public function getAcademicField(): ?string
  471.     {
  472.         return $this->academicField;
  473.     }
  474.     public function setAcademicField(?string $academicField): void
  475.     {
  476.         $this->academicField $academicField;
  477.     }
  478.     public function getCourse(): ?string
  479.     {
  480.         return $this->course;
  481.     }
  482.     public function setCourse(?int $course): void
  483.     {
  484.         $this->course $course;
  485.     }
  486.     public function getMobile2(): ?string
  487.     {
  488.         return $this->mobile_2;
  489.     }
  490.     public function setMobile2(?string $mobile_2): void
  491.     {
  492.         $this->mobile_2 $mobile_2;
  493.     }
  494. }