src/Entity/OffreEmploiCandidature.php line 26

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. /*
  4.  * Copyright (C) Office National de Publication et de Communication - All Rights Reserved
  5.  *
  6.  * Unauthorized copying of this file, via any medium is strictly prohibited by law
  7.  * This file is proprietary and confidential
  8.  */
  9. namespace App\Entity;
  10. use App\Entity\Common\AdresseTrait;
  11. use App\Entity\Common\IdTrait;
  12. use App\Validator\Constraints as AppAssert;
  13. use DateTime;
  14. use Doctrine\ORM\Mapping as ORM;
  15. use Symfony\Component\HttpFoundation\File\UploadedFile;
  16. use Symfony\Component\Validator\Constraints as Assert;
  17. /**
  18.  * @ORM\Entity(repositoryClass="App\Repository\OffreEmploiCandidatureRepository")
  19.  * @ORM\Table(name="offre_emploi_candidature")
  20.  */
  21. class OffreEmploiCandidature
  22. {
  23.     use AdresseTrait;
  24.     use IdTrait;
  25.     /** @ORM\Column(type="datetime", nullable=false) */
  26.     private $dateCreation;
  27.     /** @ORM\Column(type="string", nullable=true) */
  28.     private $libelle;
  29.     /** @ORM\Column(type="string", nullable=false) */
  30.     private $civilite;
  31.     /** @ORM\Column(type="string", nullable=false) */
  32.     private $nom;
  33.     /** @ORM\Column(type="string", nullable=true) */
  34.     private $prenom;
  35.     /** @ORM\Column(type="string", nullable=true) */
  36.     private $adresse;
  37.     /**
  38.      * @ORM\Column(type="string", nullable=false)
  39.      * @Assert\Regex("/^\d{5}$/")
  40.      */
  41.     private $codePostal;
  42.     /** @ORM\Column(type="string", nullable=true) */
  43.     private $ville;
  44.     /** @ORM\Column(type="string", nullable=true) */
  45.     private $telephone;
  46.     /**
  47.      * @ORM\Column(type="string", length=150, nullable=false)
  48.      * @Assert\Email
  49.      */
  50.     private $email;
  51.     /**
  52.      * @ORM\Column(type="text", nullable=true)
  53.      * @AppAssert\DoesNotContainsLink
  54.      */
  55.     private $commentaire;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity="Etablissement")
  58.      * @ORM\JoinColumn(name="etablissement_id", referencedColumnName="id", nullable=false)
  59.      */
  60.     private $etablissement;
  61.     /**
  62.      * @ORM\ManyToOne(targetEntity="OffreEmploi", inversedBy="candidatures")
  63.      * @ORM\JoinColumn(name="offre_emploi_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  64.      */
  65.     private $offreEmploi;
  66.     /**
  67.      * @Assert\NotBlank
  68.      * @Assert\File(
  69.      *     mimeTypes={
  70.      *         "application/pdf",
  71.      *         "application/msword",
  72.      *         "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
  73.      *     },
  74.      *     mimeTypesMessage="Le type du fichier est invalide, Les types autorisées sont pdf, doc et docx"
  75.      * )
  76.      */
  77.     private $resume;
  78.     public function __construct()
  79.     {
  80.         $this->dateCreation = new DateTime();
  81.     }
  82.     public function getDateCreation(): DateTime
  83.     {
  84.         return $this->dateCreation;
  85.     }
  86.     public function setLibelle(?string $libelle): void
  87.     {
  88.         $this->libelle $libelle;
  89.     }
  90.     public function getLibelle(): ?string
  91.     {
  92.         $offre $this->getOffreEmploi();
  93.         return $offre $offre->getLibelle() : $this->libelle;
  94.     }
  95.     public function setCivilite(?string $civilite): void
  96.     {
  97.         $this->civilite $civilite;
  98.     }
  99.     public function getCivilite(): ?string
  100.     {
  101.         return $this->civilite;
  102.     }
  103.     public function setNom(?string $nom): void
  104.     {
  105.         $this->nom $nom;
  106.     }
  107.     public function getNom(): ?string
  108.     {
  109.         return $this->nom;
  110.     }
  111.     public function setPrenom(?string $prenom): void
  112.     {
  113.         $this->prenom $prenom;
  114.     }
  115.     public function getPrenom(): ?string
  116.     {
  117.         return $this->prenom;
  118.     }
  119.     public function setTelephone(?string $telephone): void
  120.     {
  121.         $this->telephone $telephone;
  122.     }
  123.     public function getTelephone(): ?string
  124.     {
  125.         return $this->telephone;
  126.     }
  127.     public function setEmail(?string $email): void
  128.     {
  129.         $this->email $email;
  130.     }
  131.     public function getEmail(): ?string
  132.     {
  133.         return $this->email;
  134.     }
  135.     public function setCommentaire(?string $commentaire): void
  136.     {
  137.         $this->commentaire $commentaire;
  138.     }
  139.     public function getCommentaire(): ?string
  140.     {
  141.         return $this->commentaire;
  142.     }
  143.     public function setOffreEmploi(OffreEmploi $offreEmploi): void
  144.     {
  145.         $this->offreEmploi $offreEmploi;
  146.         $this->libelle $offreEmploi->getLibelle();
  147.         $this->etablissement $offreEmploi->getEtablissement();
  148.     }
  149.     public function getOffreEmploi(): ?OffreEmploi
  150.     {
  151.         return $this->offreEmploi;
  152.     }
  153.     public function setEtablissement(Etablissement $etablissement): void
  154.     {
  155.         $this->etablissement $etablissement;
  156.         $this->offreEmploi null;
  157.     }
  158.     public function getEtablissement(): ?Etablissement
  159.     {
  160.         return $this->etablissement;
  161.     }
  162.     public function setResume(UploadedFile $resume): void
  163.     {
  164.         $this->resume $resume;
  165.     }
  166.     public function getResume(): ?UploadedFile
  167.     {
  168.         return $this->resume;
  169.     }
  170. }