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.     }
  109.     #[ORM\PrePersist]
  110.     public function prePersist(): void {
  111.         if ($this->satisfactionSearches->count()) {
  112.             /** @var SatisfactionSearch $satisfaction */
  113.             foreach ($this->satisfactionSearches as $satisfaction) {
  114.                 $satisfaction->setPersonDegree($this);
  115.             }
  116.         }
  117.         if ($this->satisfactionSalaries->count()) {
  118.             /** @var SatisfactionSalary $satisfaction */
  119.             foreach ($this->satisfactionSalaries as $satisfaction) {
  120.                 $satisfaction->setPersonDegree($this);
  121.             }
  122.         }
  123.         if ($this->satisfactionCreators->count()) {
  124.             /** @var SatisfactionCreator $satisfaction */
  125.             foreach ($this->satisfactionCreators as $satisfaction) {
  126.                 $satisfaction->setPersonDegree($this);
  127.             }
  128.         }
  129.     }
  130.     public function isStatus(): bool {
  131.         return $this->status;
  132.     }
  133.     public function isAgreeRgpd(): bool {
  134.         return $this->agreeRgpd;
  135.     }
  136.     public function setAgreeRgpd(bool $agreeRgpd): self {
  137.         $this->agreeRgpd $agreeRgpd;
  138.         return $this;
  139.     }
  140.     public function setStatus(?bool $status true) {
  141.         if (!is_bool($status)) $status true;
  142.         $this->status $status;
  143.     }
  144.     public function getTypeUtils(): string {
  145.         return $this->type;
  146.     }
  147.     public function getType(): ?string {
  148.         return $this->type;
  149.     }
  150.     public function setType(?string $type): void {
  151.         $this->type $type;
  152.     }
  153.     public function getLastDegreeYear(): ?int {
  154.         return $this->lastDegreeYear;
  155.     }
  156.     public function setLastDegreeYear(?int $lastDegreeYear): void {
  157.         $this->lastDegreeYear $lastDegreeYear;
  158.     }
  159.     public function getLastDegreeMonth(): ?int {
  160.         return $this->lastDegreeMonth;
  161.     }
  162.     public function setLastDegreeMonth(?int $lastDegreeMonth): self {
  163.         $this->lastDegreeMonth $lastDegreeMonth;
  164.         return $this;
  165.     }
  166.     public function getDegree(): ?Degree {
  167.         return $this->degree;
  168.     }
  169.     public function setDegree(?Degree $degree): self {
  170.         $this->degree $degree;
  171.         return $this;
  172.     }
  173.     public function getOtherDegree(): ?string {
  174.         return $this->otherDegree;
  175.     }
  176.     public function setOtherDegree(?string $otherDegree): self {
  177.         $this->otherDegree $otherDegree;
  178.         return $this;
  179.     }
  180.     public function getCreatedDate(): ?\DateTime {
  181.         return $this->createdDate;
  182.     }
  183.     public function setCreatedDate(?\DateTime $createdDate): self {
  184.         $this->createdDate $createdDate;
  185.         return $this;
  186.     }
  187.     public function getUpdatedDate(): ?\DateTime {
  188.         return $this->updatedDate;
  189.     }
  190.     public function setUpdatedDate(?\DateTime $updatedDate): self {
  191.         $this->updatedDate $updatedDate;
  192.         return $this;
  193.     }
  194.     public function getClientUpdateDate(): ?\DateTime {
  195.         return $this->clientUpdateDate;
  196.     }
  197.     public function setClientUpdateDate(?\DateTime $clientUpdateDate): self {
  198.         $this->clientUpdateDate $clientUpdateDate;
  199.         return $this;
  200.     }
  201.     public function getPreviousEndedContract(): ?\DateTime {
  202.         return $this->previousEndedContract;
  203.     }
  204.     public function setPreviousEndedContract(?\DateTime $previousEndedContract): self {
  205.         $this->previousEndedContract $previousEndedContract;
  206.         return $this;
  207.     }
  208.     public function getSchool(): ?School {
  209.         return $this->school;
  210.     }
  211.     public function setSchool(?School $school): self {
  212.         $this->school $school;
  213.         return $this;
  214.     }
  215.     public function getRegistrationStudentSchool(): ?string {
  216.         return $this->registrationStudentSchool;
  217.     }
  218.     public function setRegistrationStudentSchool(?string $registrationStudentSchool): self {
  219.         $this->registrationStudentSchool $registrationStudentSchool;
  220.         return $this;
  221.     }
  222.     public function isCheckSchool(): ?bool {
  223.         return $this->checkSchool;
  224.     }
  225.     public function setCheckSchool(?bool $checkSchool false): self {
  226.         $this->checkSchool $checkSchool;
  227.         return $this;
  228.     }
  229.     public function getOtherSchool(): ?string {
  230.         return $this->otherSchool;
  231.     }
  232.     public function setOtherSchool(?string $otherSchool): self {
  233.         $this->otherSchool $otherSchool;
  234.         return $this;
  235.     }
  236.     public function getLastedCompany(): ?Company {
  237.         return $this->lastedCompany;
  238.     }
  239.     public function setLastedCompany(?Company $lastedCompany): self {
  240.         $this->lastedCompany $lastedCompany;
  241.         return $this;
  242.     }
  243.     public function getMonthlySalary(): ?int {
  244.         return $this->monthlySalary;
  245.     }
  246.     public function setMonthlySalary(?int $monthlySalary): self {
  247.         $this->monthlySalary $monthlySalary;
  248.         return $this;
  249.     }
  250.     public function getActivity(): ?Activity {
  251.         return $this->activity;
  252.     }
  253.     public function setActivity(?Activity $activity): self {
  254.         $this->activity $activity;
  255.         return $this;
  256.     }
  257.     public function getContract(): ?Contract {
  258.         return $this->contract;
  259.     }
  260.     public function setContract(?Contract $contract): self {
  261.         $this->contract $contract;
  262.         return $this;
  263.     }
  264.     public function getCompany(): ?Company {
  265.         return $this->company;
  266.     }
  267.     public function setCompany(?Company $company): self {
  268.         $this->company $company;
  269.         return $this;
  270.     }
  271.     public function getSectorArea(): ?SectorArea {
  272.         return $this->sectorArea;
  273.     }
  274.     public function setSectorArea(?SectorArea $sectorArea): self {
  275.         $this->sectorArea $sectorArea;
  276.         return $this;
  277.     }
  278.     public function getOtherActivity(): ?string {
  279.         return $this->otherActivity;
  280.     }
  281.     public function setOtherActivity(?string $otherActivity): self {
  282.         $this->otherActivity $otherActivity;
  283.         return $this;
  284.     }
  285.     public function getTemporaryPasswd(): ?string {
  286.         return $this->temporaryPasswd;
  287.     }
  288.     public function setTemporaryPasswd(?string $temporaryPasswd): self {
  289.         $this->temporaryPasswd $temporaryPasswd;
  290.         return $this;
  291.     }
  292.     public function addSocialNetwork(SocialNetwork $socialNetwork): self {
  293.         $this->socialNetworks->add($socialNetwork);
  294.         return $this;
  295.     }
  296.     public function removeSocialNetwork(SocialNetwork $socialNetwork): bool {
  297.         return $this->socialNetworks->removeElement($socialNetwork);
  298.     }
  299.     public function getSocialNetworks(): Collection {
  300.         return $this->socialNetworks;
  301.     }
  302.     public function addInfoCreator(InfoCreator $infoCreator): self {
  303.         $this->infoCreators->add($infoCreator);
  304.         return $this;
  305.     }
  306.     public function removeInfoCreator(InfoCreator $infoCreator): bool {
  307.         return $this->infoCreators->removeElement($infoCreator);
  308.     }
  309.     public function getInfoCreators(): Collection {
  310.         return $this->infoCreators;
  311.     }
  312.     public function addSatisfactionSalary(SatisfactionSalary $satisfactionSalary): self {
  313.         $this->satisfactionSalaries->add($satisfactionSalary);
  314.         return $this;
  315.     }
  316.     public function removeSatisfactionSalary(SatisfactionSalary $satisfactionSalary): bool {
  317.         return $this->satisfactionSalaries->removeElement($satisfactionSalary);
  318.     }
  319.     public function getSatisfactionSalaries(): Collection {
  320.         return $this->satisfactionSalaries;
  321.     }
  322.     public function addSatisfactionSearch(SatisfactionSearch $satisfactionSearch): self {
  323.         $this->satisfactionSearches->add($satisfactionSearch);
  324.         return $this;
  325.     }
  326.     public function removeSatisfactionSearch(SatisfactionSearch $satisfactionSearch): bool {
  327.         return $this->satisfactionSearches->removeElement($satisfactionSearch);
  328.     }
  329.     public function getSatisfactionSearches(): Collection {
  330.         return $this->satisfactionSearches;
  331.     }
  332.     public function addSatisfactionCreator(SatisfactionCreator $satisfactionCreator): self {
  333.         $this->satisfactionCreators->add($satisfactionCreator);
  334.         return $this;
  335.     }
  336.     public function removeSatisfactionCreator(SatisfactionCreator $satisfactionCreator): bool {
  337.         return $this->satisfactionCreators->removeElement($satisfactionCreator);
  338.     }
  339.     public function getSatisfactionCreators(): Collection {
  340.         return $this->satisfactionCreators;
  341.     }
  342.     public function __toString() {
  343.         $email "Pas d'email";
  344.         if ($this->getEmail()) {
  345.             $email ucfirst($this->getEmail());
  346.         }
  347.         return sprintf('%s  %s  ( %s )',
  348.             ucfirst($this->getFirstname()),
  349.             ucfirst($this->getLastname()),
  350.             $email
  351.         );
  352.     }
  353.     public function getStatus(): bool {
  354.         return $this->status;
  355.     }
  356.     public function setUser(?User $user null): self {
  357.         $this->user $user;
  358.         return $this;
  359.     }
  360.     public function getUser(): ?User {
  361.         return $this->user;
  362.     }
  363.     public function getLastIdSatisfactionSalary(): ?int {
  364.         return $this->lastIdSatisfactionSalary;
  365.     }
  366.     public function setLastIdSatisfactionSalary(?int $lastIdSatisfactionSalary): self {
  367.         $this->lastIdSatisfactionSalary $lastIdSatisfactionSalary;
  368.         return $this;
  369.     }
  370.     public function getLastIdSatisfactionSearch(): ?int {
  371.         return $this->lastIdSatisfactionSearch;
  372.     }
  373.     public function setLastIdSatisfactionSearch(?int $lastIdSatisfactionSearch): self {
  374.         $this->lastIdSatisfactionSearch $lastIdSatisfactionSearch;
  375.         return $this;
  376.     }
  377.     public function getLastIdSatisfactionCreator(): ?int {
  378.         return $this->lastIdSatisfactionCreator;
  379.     }
  380.     public function setLastIdSatisfactionCreator(?int $lastIdSatisfactionCreator): self {
  381.         $this->lastIdSatisfactionCreator $lastIdSatisfactionCreator;
  382.         return $this;
  383.     }
  384.     public function setUnlocked(?bool $unlocked): self {
  385.         $this->unlocked $unlocked;
  386.         return $this;
  387.     }
  388.     public function isUnlocked(): ?bool {
  389.         return $this->unlocked;
  390.     }
  391.     /**
  392.      * @return bool
  393.      */
  394.     public function isDiaspora(): bool
  395.     {
  396.         return $this->diaspora;
  397.     }
  398.     /**
  399.      * @param bool $diaspora
  400.      * @return PersonDegree
  401.      */
  402.     public function setDiaspora(bool $diaspora): PersonDegree
  403.     {
  404.         $this->diaspora $diaspora;
  405.         return $this;
  406.     }
  407.     /**
  408.      * @return Country|null
  409.      */
  410.     public function getResidenceCountry(): ?Country
  411.     {
  412.         return $this->residenceCountry;
  413.     }
  414.     /**
  415.      * @param Country|null $residenceCountry
  416.      * @return PersonDegree
  417.      */
  418.     public function setResidenceCountry(?Country $residenceCountry): PersonDegree
  419.     {
  420.         $this->residenceCountry $residenceCountry;
  421.         return $this;
  422.     }
  423.     /**
  424.      * @return string|null
  425.      */
  426.     public function getAddressDiaspora(): ?string
  427.     {
  428.         return $this->addressDiaspora;
  429.     }
  430.     /**
  431.      * @param string|null $addressDiaspora
  432.      * @return PersonDegree
  433.      */
  434.     public function setAddressDiaspora(?string $addressDiaspora): PersonDegree
  435.     {
  436.         $this->addressDiaspora $addressDiaspora;
  437.         return $this;
  438.     }
  439.     /**
  440.      * @return Region|null
  441.      */
  442.     public function getResidenceRegion(): ?Region
  443.     {
  444.         return $this->residenceRegion;
  445.     }
  446.     /**
  447.      * @param Region|null $residenceRegion
  448.      * @return PersonDegree
  449.      */
  450.     public function setResidenceRegion(?Region $residenceRegion): PersonDegree
  451.     {
  452.         $this->residenceRegion $residenceRegion;
  453.         return $this;
  454.     }
  455.     /**
  456.      * @return Prefecture|null
  457.      */
  458.     public function getPrefecture(): ?Prefecture {
  459.         return $this->addressCity?->getPrefecture();
  460.     }
  461.     /**
  462.      * @param Prefecture|null $prefecture
  463.      * @return PersonDegree
  464.      */
  465.     public function setPrefecture(?Prefecture $prefecture): PersonDegree
  466.     {
  467.         return $this;
  468.     }
  469. }