src/Entity/PersonDegree.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PersonDegreeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use JMS\Serializer\Annotation\ExclusionPolicy;
  8. use JMS\Serializer\Annotation\Expose;
  9. #[ORM\Table(name'person_degree')]
  10. #[ORM\Entity(repositoryClassPersonDegreeRepository::class)]
  11. #[ORM\HasLifecycleCallbacks]
  12. class PersonDegree {
  13.     use Person;
  14.     #[ORM\Column(name'status'type'boolean'nullabletrue)]
  15.     private bool $status true;
  16.     #[ORM\Column(name'type'type'string'nullabletrue)]
  17.     private ?string $type;
  18.     #[ORM\Column(name'agree_rgpd'type'boolean'nullabletrue)]
  19.     private bool $agreeRgpd false;
  20.     #[ORM\Column(name'last_degree_year'type'integer'nullabletrue)]
  21.     private ?int $lastDegreeYear;
  22.     #[ORM\Column(name'last_degree_month'type'integer'nullabletrue)]
  23.     private ?int $lastDegreeMonth;
  24.     #[ORM\Column(name'other_degree'type'string'length255nullabletrue)]
  25.     private ?string $otherDegree;
  26.     #[ORM\Column(name'diaspora'type'boolean')]
  27.     private bool $diaspora false;
  28.     #[ORM\ManyToOne(targetEntityCountry::class)]
  29.     private ?Country $residenceCountry null;
  30.     #[ORM\ManyToOne(targetEntityRegion::class)]
  31.     private ?Region $residenceRegion null;
  32.     #[ORM\Column(name'address_diaspora'type'string'length255nullabletrue)]
  33.     private ?string $addressDiaspora;
  34.     #[ORM\Column(name'created_date'type'datetime'nullabletrue)]
  35.     private ?\DateTime $createdDate;
  36.     #[ORM\Column(name'updated_date'type'datetime'nullabletrue)]
  37.     private ?\DateTime $updatedDate null;
  38.     #[ORM\Column(name'client_updated_date'type'datetime'nullabletrue)]
  39.     private ?\DateTime $clientUpdateDate null;
  40.     #[ORM\Column(name'previousEndedContract'type'datetime'nullabletrue)]
  41.     private ?\DateTime $previousEndedContract null;
  42.     #[ORM\Column(name'registration_student_school'type'string'length255nullabletrue)]
  43.     private ?string $registrationStudentSchool;
  44.     #[ORM\Column(name'check_school'type'boolean'length255nullabletrue)]
  45.     private ?bool $checkSchool false;
  46.     #[ORM\Column(name'other_school'type'string'length255nullabletrue)]
  47.     private ?string $otherSchool;
  48.     #[ORM\Column(name'monthly_salary'type'integer'nullabletrue)]
  49.     private ?int $monthlySalary;
  50.     #[ORM\Column(name'other_activity'type'string'length255nullabletrue)]
  51.     private ?string $otherActivity;
  52.     #[ORM\Column(name'temporary_passwd'type'string'length255nullabletrue)]
  53.     private ?string $temporaryPasswd;
  54.     #[ORM\Column(name'lastIdSatisfactionSalary'type'integer'nullabletrue)]
  55.     private ?int $lastIdSatisfactionSalary;
  56.     #[ORM\Column(name'lastIdSatisfactionSearch'type'integer'nullabletrue)]
  57.     private ?int $lastIdSatisfactionSearch;
  58.     #[ORM\Column(name'lastIdSatisfactionCreato'type'integer'nullabletrue)]
  59.     private ?int $lastIdSatisfactionCreator;
  60.     #[ORM\ManyToOne(targetEntityDegree::class)]
  61.     #[ORM\JoinColumn(name'id_degree'referencedColumnName'id'nullabletrue)]
  62.     private ?Degree $degree null;
  63.     #[ORM\ManyToMany(targetEntitySocialNetwork::class, cascade: ['persist''remove'])]
  64.     #[ORM\JoinTable(name'persons_socials')]
  65.     #[ORM\JoinColumn(name'person_id'referencedColumnName'id')]
  66.     #[ORM\InverseJoinColumn(name'social_id'referencedColumnName'id')]
  67.     private Collection $socialNetworks;
  68.     #[ORM\ManyToOne(targetEntitySchool::class)]
  69.     #[ORM\JoinColumn(name'school_id'referencedColumnName'id'nullabletrue)]
  70.     private ?School $school null;
  71.     #[ORM\ManyToOne(targetEntityCompany::class)]
  72.     #[ORM\JoinColumn(name'lasted_company_id'referencedColumnName'id'nullabletrue)]
  73.     private ?Company $lastedCompany null;
  74.     #[ORM\ManyToOne(targetEntityActivity::class)]
  75.     #[ORM\JoinColumn(nullabletrue)]
  76.     private ?Activity $activity null;
  77.     #[ORM\ManyToOne(targetEntitySectorArea::class)]
  78.     #[ORM\JoinColumn(name'id_sectorArea'referencedColumnName'id')]
  79.     private ?SectorArea $sectorArea;
  80.     #[ORM\ManyToOne(targetEntityContract::class)]
  81.     #[ORM\JoinColumn(name'lasted_contract_id'referencedColumnName'id'nullabletrue)]
  82.     private ?Contract $contract;
  83.     #[ORM\ManyToOne(targetEntityCompany::class)]
  84.     #[ORM\JoinColumn(name'lasted_company_id'referencedColumnName'id'nullabletrue)]
  85.     private ?Company $company null;
  86.     #[ORM\OneToOne(inversedBy'personDegree'targetEntityUser::class)]
  87.     #[ORM\JoinColumn(name'user_id'referencedColumnName'id'nullabletrue)]
  88.     private ?User $user null;
  89.     #[ORM\ManyToMany(targetEntityInfoCreator::class, cascade: ['persist'])]
  90.     #[ORM\JoinTable(name'person_degree_info_creators')]
  91.     #[ORM\JoinColumn(name'person_degree_id'referencedColumnName'id')]
  92.     #[ORM\InverseJoinColumn(name'info_creator_id'referencedColumnName'id')]
  93.     private Collection $infoCreators;
  94.     #[ORM\OneToMany(mappedBy'personDegree'targetEntitySatisfactionSalary::class, cascade: ['persist''remove'])]
  95.     private Collection $satisfactionSalaries;
  96.     #[ORM\OneToMany(mappedBy'personDegree'targetEntitySatisfactionSearch::class, cascade: ['persist''remove'])]
  97.     private Collection $satisfactionSearches;
  98.     #[ORM\OneToMany(mappedBy'personDegree'targetEntitySatisfactionCreator::class, cascade: ['persist''remove'])]
  99.     private Collection $satisfactionCreators;
  100.     #[ORM\Column(name'unlocked'type'boolean'nullabletrue)]
  101.     private ?bool $unlocked true;
  102.     public function __construct() {
  103.         $this->createdDate = new \DateTime();
  104.         $this->socialNetworks = new ArrayCollection();
  105.         $this->satisfactionSearches = new ArrayCollection();
  106.         $this->satisfactionSalaries = new ArrayCollection();
  107.         $this->satisfactionCreators = new ArrayCollection();
  108.         $this->birthDate = new \DateTime();
  109.         $this->birthDate->modify('-12 years');
  110.     }
  111.     #[ORM\PrePersist]
  112.     public function prePersist(): void {
  113.         if ($this->satisfactionSearches->count()) {
  114.             /** @var SatisfactionSearch $satisfaction */
  115.             foreach ($this->satisfactionSearches as $satisfaction) {
  116.                 $satisfaction->setPersonDegree($this);
  117.             }
  118.         }
  119.         if ($this->satisfactionSalaries->count()) {
  120.             /** @var SatisfactionSalary $satisfaction */
  121.             foreach ($this->satisfactionSalaries as $satisfaction) {
  122.                 $satisfaction->setPersonDegree($this);
  123.             }
  124.         }
  125.         if ($this->satisfactionCreators->count()) {
  126.             /** @var SatisfactionCreator $satisfaction */
  127.             foreach ($this->satisfactionCreators as $satisfaction) {
  128.                 $satisfaction->setPersonDegree($this);
  129.             }
  130.         }
  131.     }
  132.     public function isStatus(): bool {
  133.         return $this->status;
  134.     }
  135.     public function isAgreeRgpd(): bool {
  136.         return $this->agreeRgpd;
  137.     }
  138.     public function setAgreeRgpd(bool $agreeRgpd): self {
  139.         $this->agreeRgpd $agreeRgpd;
  140.         return $this;
  141.     }
  142.     public function setStatus(?bool $status true) {
  143.         if (!is_bool($status)) $status true;
  144.         $this->status $status;
  145.     }
  146.     public function getTypeUtils(): string {
  147.         return $this->type;
  148.     }
  149.     public function getType(): ?string {
  150.         return $this->type;
  151.     }
  152.     public function setType(?string $type): void {
  153.         $this->type $type;
  154.     }
  155.     public function getLastDegreeYear(): ?int {
  156.         return $this->lastDegreeYear;
  157.     }
  158.     public function setLastDegreeYear(?int $lastDegreeYear): void {
  159.         $this->lastDegreeYear $lastDegreeYear;
  160.     }
  161.     public function getLastDegreeMonth(): ?int {
  162.         return $this->lastDegreeMonth;
  163.     }
  164.     public function setLastDegreeMonth(?int $lastDegreeMonth): self {
  165.         $this->lastDegreeMonth $lastDegreeMonth;
  166.         return $this;
  167.     }
  168.     public function getDegree(): ?Degree {
  169.         return $this->degree;
  170.     }
  171.     public function setDegree(?Degree $degree): self {
  172.         $this->degree $degree;
  173.         return $this;
  174.     }
  175.     public function getOtherDegree(): ?string {
  176.         return $this->otherDegree;
  177.     }
  178.     public function setOtherDegree(?string $otherDegree): self {
  179.         $this->otherDegree $otherDegree;
  180.         return $this;
  181.     }
  182.     public function getCreatedDate(): ?\DateTime {
  183.         return $this->createdDate;
  184.     }
  185.     public function setCreatedDate(?\DateTime $createdDate): self {
  186.         $this->createdDate $createdDate;
  187.         return $this;
  188.     }
  189.     public function getUpdatedDate(): ?\DateTime {
  190.         return $this->updatedDate;
  191.     }
  192.     public function setUpdatedDate(?\DateTime $updatedDate): self {
  193.         $this->updatedDate $updatedDate;
  194.         return $this;
  195.     }
  196.     public function getClientUpdateDate(): ?\DateTime {
  197.         return $this->clientUpdateDate;
  198.     }
  199.     public function setClientUpdateDate(?\DateTime $clientUpdateDate): self {
  200.         $this->clientUpdateDate $clientUpdateDate;
  201.         return $this;
  202.     }
  203.     public function getPreviousEndedContract(): ?\DateTime {
  204.         return $this->previousEndedContract;
  205.     }
  206.     public function setPreviousEndedContract(?\DateTime $previousEndedContract): self {
  207.         $this->previousEndedContract $previousEndedContract;
  208.         return $this;
  209.     }
  210.     public function getSchool(): ?School {
  211.         return $this->school;
  212.     }
  213.     public function setSchool(?School $school): self {
  214.         $this->school $school;
  215.         return $this;
  216.     }
  217.     public function getRegistrationStudentSchool(): ?string {
  218.         return $this->registrationStudentSchool;
  219.     }
  220.     public function setRegistrationStudentSchool(?string $registrationStudentSchool): self {
  221.         $this->registrationStudentSchool $registrationStudentSchool;
  222.         return $this;
  223.     }
  224.     public function isCheckSchool(): ?bool {
  225.         return $this->checkSchool;
  226.     }
  227.     public function setCheckSchool(?bool $checkSchool false): self {
  228.         $this->checkSchool $checkSchool;
  229.         return $this;
  230.     }
  231.     public function getOtherSchool(): ?string {
  232.         return $this->otherSchool;
  233.     }
  234.     public function setOtherSchool(?string $otherSchool): self {
  235.         $this->otherSchool $otherSchool;
  236.         return $this;
  237.     }
  238.     public function getLastedCompany(): ?Company {
  239.         return $this->lastedCompany;
  240.     }
  241.     public function setLastedCompany(?Company $lastedCompany): self {
  242.         $this->lastedCompany $lastedCompany;
  243.         return $this;
  244.     }
  245.     public function getMonthlySalary(): ?int {
  246.         return $this->monthlySalary;
  247.     }
  248.     public function setMonthlySalary(?int $monthlySalary): self {
  249.         $this->monthlySalary $monthlySalary;
  250.         return $this;
  251.     }
  252.     public function getActivity(): ?Activity {
  253.         return $this->activity;
  254.     }
  255.     public function setActivity(?Activity $activity): self {
  256.         $this->activity $activity;
  257.         return $this;
  258.     }
  259.     public function getContract(): ?Contract {
  260.         return $this->contract;
  261.     }
  262.     public function setContract(?Contract $contract): self {
  263.         $this->contract $contract;
  264.         return $this;
  265.     }
  266.     public function getCompany(): ?Company {
  267.         return $this->company;
  268.     }
  269.     public function setCompany(?Company $company): self {
  270.         $this->company $company;
  271.         return $this;
  272.     }
  273.     public function getSectorArea(): ?SectorArea {
  274.         return $this->sectorArea;
  275.     }
  276.     public function setSectorArea(?SectorArea $sectorArea): self {
  277.         $this->sectorArea $sectorArea;
  278.         return $this;
  279.     }
  280.     public function getOtherActivity(): ?string {
  281.         return $this->otherActivity;
  282.     }
  283.     public function setOtherActivity(?string $otherActivity): self {
  284.         $this->otherActivity $otherActivity;
  285.         return $this;
  286.     }
  287.     public function getTemporaryPasswd(): ?string {
  288.         return $this->temporaryPasswd;
  289.     }
  290.     public function setTemporaryPasswd(?string $temporaryPasswd): self {
  291.         $this->temporaryPasswd $temporaryPasswd;
  292.         return $this;
  293.     }
  294.     public function addSocialNetwork(SocialNetwork $socialNetwork): self {
  295.         $this->socialNetworks->add($socialNetwork);
  296.         return $this;
  297.     }
  298.     public function removeSocialNetwork(SocialNetwork $socialNetwork): bool {
  299.         return $this->socialNetworks->removeElement($socialNetwork);
  300.     }
  301.     public function getSocialNetworks(): Collection {
  302.         return $this->socialNetworks;
  303.     }
  304.     public function addInfoCreator(InfoCreator $infoCreator): self {
  305.         $this->infoCreators->add($infoCreator);
  306.         return $this;
  307.     }
  308.     public function removeInfoCreator(InfoCreator $infoCreator): bool {
  309.         return $this->infoCreators->removeElement($infoCreator);
  310.     }
  311.     public function getInfoCreators(): Collection {
  312.         return $this->infoCreators;
  313.     }
  314.     public function addSatisfactionSalary(SatisfactionSalary $satisfactionSalary): self {
  315.         $this->satisfactionSalaries->add($satisfactionSalary);
  316.         return $this;
  317.     }
  318.     public function removeSatisfactionSalary(SatisfactionSalary $satisfactionSalary): bool {
  319.         return $this->satisfactionSalaries->removeElement($satisfactionSalary);
  320.     }
  321.     public function getSatisfactionSalaries(): Collection {
  322.         return $this->satisfactionSalaries;
  323.     }
  324.     public function addSatisfactionSearch(SatisfactionSearch $satisfactionSearch): self {
  325.         $this->satisfactionSearches->add($satisfactionSearch);
  326.         return $this;
  327.     }
  328.     public function removeSatisfactionSearch(SatisfactionSearch $satisfactionSearch): bool {
  329.         return $this->satisfactionSearches->removeElement($satisfactionSearch);
  330.     }
  331.     public function getSatisfactionSearches(): Collection {
  332.         return $this->satisfactionSearches;
  333.     }
  334.     public function addSatisfactionCreator(SatisfactionCreator $satisfactionCreator): self {
  335.         $this->satisfactionCreators->add($satisfactionCreator);
  336.         return $this;
  337.     }
  338.     public function removeSatisfactionCreator(SatisfactionCreator $satisfactionCreator): bool {
  339.         return $this->satisfactionCreators->removeElement($satisfactionCreator);
  340.     }
  341.     public function getSatisfactionCreators(): Collection {
  342.         return $this->satisfactionCreators;
  343.     }
  344.     public function __toString() {
  345.         $email "Pas d'email";
  346.         if ($this->getEmail()) {
  347.             $email ucfirst($this->getEmail());
  348.         }
  349.         return sprintf('%s  %s  ( %s )',
  350.             ucfirst($this->getFirstname()),
  351.             ucfirst($this->getLastname()),
  352.             $email
  353.         );
  354.     }
  355.     public function getStatus(): bool {
  356.         return $this->status;
  357.     }
  358.     public function setUser(?User $user null): self {
  359.         $this->user $user;
  360.         return $this;
  361.     }
  362.     public function getUser(): ?User {
  363.         return $this->user;
  364.     }
  365.     public function getLastIdSatisfactionSalary(): ?int {
  366.         return $this->lastIdSatisfactionSalary;
  367.     }
  368.     public function setLastIdSatisfactionSalary(?int $lastIdSatisfactionSalary): self {
  369.         $this->lastIdSatisfactionSalary $lastIdSatisfactionSalary;
  370.         return $this;
  371.     }
  372.     public function getLastIdSatisfactionSearch(): ?int {
  373.         return $this->lastIdSatisfactionSearch;
  374.     }
  375.     public function setLastIdSatisfactionSearch(?int $lastIdSatisfactionSearch): self {
  376.         $this->lastIdSatisfactionSearch $lastIdSatisfactionSearch;
  377.         return $this;
  378.     }
  379.     public function getLastIdSatisfactionCreator(): ?int {
  380.         return $this->lastIdSatisfactionCreator;
  381.     }
  382.     public function setLastIdSatisfactionCreator(?int $lastIdSatisfactionCreator): self {
  383.         $this->lastIdSatisfactionCreator $lastIdSatisfactionCreator;
  384.         return $this;
  385.     }
  386.     public function setUnlocked(?bool $unlocked): self {
  387.         $this->unlocked $unlocked;
  388.         return $this;
  389.     }
  390.     public function isUnlocked(): ?bool {
  391.         return $this->unlocked;
  392.     }
  393.     /**
  394.      * @return bool
  395.      */
  396.     public function isDiaspora(): bool
  397.     {
  398.         return $this->diaspora;
  399.     }
  400.     /**
  401.      * @param bool $diaspora
  402.      * @return PersonDegree
  403.      */
  404.     public function setDiaspora(bool $diaspora): PersonDegree
  405.     {
  406.         $this->diaspora $diaspora;
  407.         return $this;
  408.     }
  409.     /**
  410.      * @return Country|null
  411.      */
  412.     public function getResidenceCountry(): ?Country
  413.     {
  414.         return $this->residenceCountry;
  415.     }
  416.     /**
  417.      * @param Country|null $residenceCountry
  418.      * @return PersonDegree
  419.      */
  420.     public function setResidenceCountry(?Country $residenceCountry): PersonDegree
  421.     {
  422.         $this->residenceCountry $residenceCountry;
  423.         return $this;
  424.     }
  425.     /**
  426.      * @return string|null
  427.      */
  428.     public function getAddressDiaspora(): ?string
  429.     {
  430.         return $this->addressDiaspora;
  431.     }
  432.     /**
  433.      * @param string|null $addressDiaspora
  434.      * @return PersonDegree
  435.      */
  436.     public function setAddressDiaspora(?string $addressDiaspora): PersonDegree
  437.     {
  438.         $this->addressDiaspora $addressDiaspora;
  439.         return $this;
  440.     }
  441.     /**
  442.      * @return Region|null
  443.      */
  444.     public function getResidenceRegion(): ?Region
  445.     {
  446.         return $this->residenceRegion;
  447.     }
  448.     /**
  449.      * @param Region|null $residenceRegion
  450.      * @return PersonDegree
  451.      */
  452.     public function setResidenceRegion(?Region $residenceRegion): PersonDegree
  453.     {
  454.         $this->residenceRegion $residenceRegion;
  455.         return $this;
  456.     }
  457.     /**
  458.      * @return Prefecture|null
  459.      */
  460.     public function getPrefecture(): ?Prefecture {
  461.         return $this->addressCity?->getPrefecture();
  462.     }
  463.     /**
  464.      * @param Prefecture|null $prefecture
  465.      * @return PersonDegree
  466.      */
  467.     public function setPrefecture(?Prefecture $prefecture): PersonDegree
  468.     {
  469.         return $this;
  470.     }
  471. }