src/Entity/JobOfferCandidacy.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\JobOfferCandidacyRepository;
  4. use Cofondateur\SocleTechniqueBundle\Annotation\CrudField;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. use Vich\UploaderBundle\Mapping\Annotation\Uploadable;
  11. use App\Form\JobOfferCandidacyFileFormType;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. /**
  14.  * @ORM\Entity(repositoryClass=JobOfferCandidacyRepository::class)
  15.  * @Vich\Uploadable
  16.  * @Uploadable()
  17.  */
  18. class JobOfferCandidacy
  19. {
  20.     /**
  21.      * @ORM\Id
  22.      * @ORM\GeneratedValue
  23.      * @ORM\Column(type="integer")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\Column(type="string", length=255)
  28.      * @CrudField(index=true, label="Nom")
  29.      */
  30.     private $name;
  31.     /**
  32.      * @ORM\Column(type="string", length=255)
  33.      * @CrudField(label="Prénom")
  34.      */
  35.     private $firstname;
  36.     /**
  37.      * @ORM\Column(type="string", length=255)
  38.      * @CrudField(label="Email")
  39.      */
  40.     private $email;
  41.     /**
  42.      * @ORM\Column(type="string", length=255)
  43.      * @CrudField(index=true, label="Téléphone")
  44.      * @Assert\Regex(
  45.      *     pattern="/^0[1-9]([ .-]?[0-9]{2}){4}$/",
  46.      *     message="Le numéro de téléphone doit être au format français."
  47.      * )
  48.      */
  49.     private $phone;
  50.     /**
  51.      * @ORM\Column(type="text")
  52.      * @CrudField(label="Message")
  53.      */
  54.     private $message;
  55.     /**
  56.      * @ORM\Column(type="string", nullable=true)
  57.      */
  58.     private $cvName;
  59.     /**
  60.      * @ORM\Column(type="integer", nullable=true)
  61.      */
  62.     private $cvSize;
  63.     /**
  64.      * @ORM\Column(type="datetime", nullable=true)
  65.      */
  66.     private $cvUpdatedAt;
  67.     /**
  68.      * @Vich\UploadableField(mapping="default", fileNameProperty="cvName", size="cvSize")
  69.      * @CrudField(label="CV", imagePreview=false)
  70.      */
  71.     private $cvFile;
  72.     /**
  73.      * @ORM\Column(type="string", nullable=true)
  74.      */
  75.     private $lmName;
  76.     /**
  77.      * @ORM\Column(type="integer", nullable=true)
  78.      */
  79.     private $lmSize;
  80.     /**
  81.      * @ORM\Column(type="datetime", nullable=true)
  82.      */
  83.     private $lmUpdatedAt;
  84.     /**
  85.      * @Vich\UploadableField(mapping="default", fileNameProperty="lmName", size="lmSize")
  86.      * @CrudField(label="Lettre de motivation", imagePreview=false)
  87.      */
  88.     private $lmFile;
  89.     /**
  90.      * @ORM\ManyToOne(targetEntity=JobOffer::class, inversedBy="jobOfferCandidacies")
  91.      * @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
  92.      * @CrudField(label="Offre d'emploi", index=true)
  93.      */
  94.     private $jobOffer;
  95.     /**
  96.      * @ORM\Column(type="boolean")
  97.      * @CrudField(label="J'accepte la politique de confidentialité")
  98.      */
  99.     private $confidentiality;
  100.     /**
  101.      * @ORM\Column(type="date")
  102.      * @CrudField(index=true, label="Date de soumission")
  103.      */
  104.     private $createdAt;
  105.     public function __toString(): string
  106.     {
  107.         return $this->getId() ?? "N/A";
  108.     }
  109.     public function getId(): ?int
  110.     {
  111.         return $this->id;
  112.     }
  113.     public function getName(): ?string
  114.     {
  115.         return $this->name;
  116.     }
  117.     public function setName(string $name): self
  118.     {
  119.         $this->name $name;
  120.         return $this;
  121.     }
  122.     public function getFirstname(): ?string
  123.     {
  124.         return $this->firstname;
  125.     }
  126.     public function setFirstname(string $firstname): self
  127.     {
  128.         $this->firstname $firstname;
  129.         return $this;
  130.     }
  131.     public function getEmail(): ?string
  132.     {
  133.         return $this->email;
  134.     }
  135.     public function setEmail(string $email): self
  136.     {
  137.         $this->email $email;
  138.         return $this;
  139.     }
  140.     public function getPhone(): ?string
  141.     {
  142.         return $this->phone;
  143.     }
  144.     public function setPhone(string $phone): self
  145.     {
  146.         $this->phone $phone;
  147.         return $this;
  148.     }
  149.     public function getMessage(): ?string
  150.     {
  151.         return $this->message;
  152.     }
  153.     public function setMessage(string $message): self
  154.     {
  155.         $this->message $message;
  156.         return $this;
  157.     }
  158.     public function getCvName(): ?string
  159.     {
  160.         return $this->cvName;
  161.     }
  162.     public function setCvName(?string $cvName): self
  163.     {
  164.         $this->cvName $cvName;
  165.         return $this;
  166.     }
  167.     public function getCvSize(): ?int
  168.     {
  169.         return $this->cvSize;
  170.     }
  171.     public function setCvSize(?int $cvSize): self
  172.     {
  173.         $this->cvSize $cvSize;
  174.         return $this;
  175.     }
  176.     public function getCvUpdatedAt(): ?\DateTimeInterface
  177.     {
  178.         return $this->cvUpdatedAt;
  179.     }
  180.     public function setCvUpdatedAt(?\DateTimeInterface $cvUpdatedAt): self
  181.     {
  182.         $this->cvUpdatedAt $cvUpdatedAt;
  183.         return $this;
  184.     }
  185.     public function getCvFile(): ?File
  186.     {
  187.         return $this->cvFile;
  188.     }
  189.     public function setCvFile(?File $cvFile): self
  190.     {
  191.         $this->cvFile $cvFile;
  192.         if (null !== $this->cvFile) {
  193.             $this->cvUpdatedAt = new \DateTimeImmutable();
  194.         }
  195.         return $this;
  196.     }
  197.     public function getLmName(): ?string
  198.     {
  199.         return $this->lmName;
  200.     }
  201.     public function setLmName(?string $lmName): self
  202.     {
  203.         $this->lmName $lmName;
  204.         return $this;
  205.     }
  206.     public function getLmSize(): ?int
  207.     {
  208.         return $this->lmSize;
  209.     }
  210.     public function setLmSize(?int $lmSize): self
  211.     {
  212.         $this->lmSize $lmSize;
  213.         return $this;
  214.     }
  215.     public function getLmUpdatedAt(): ?\DateTimeInterface
  216.     {
  217.         return $this->lmUpdatedAt;
  218.     }
  219.     public function setLmUpdatedAt(?\DateTimeInterface $lmUpdatedAt): self
  220.     {
  221.         $this->lmUpdatedAt $lmUpdatedAt;
  222.         return $this;
  223.     }
  224.     public function getLmFile(): ?File
  225.     {
  226.         return $this->lmFile;
  227.     }
  228.     public function setLmFile(?File $lmFile): self
  229.     {
  230.         $this->lmFile $lmFile;
  231.         if (null !== $this->lmFile) {
  232.             $this->lmUpdatedAt = new \DateTimeImmutable();
  233.         }
  234.         return $this;
  235.     }
  236.     public function getJobOffer(): ?jobOffer
  237.     {
  238.         return $this->jobOffer;
  239.     }
  240.     public function setJobOffer(?jobOffer $jobOffer): self
  241.     {
  242.         $this->jobOffer $jobOffer;
  243.         return $this;
  244.     }
  245.     public function isConfidentiality(): ?bool
  246.     {
  247.         return $this->confidentiality;
  248.     }
  249.     public function setConfidentiality(bool $confidentiality): self
  250.     {
  251.         $this->confidentiality $confidentiality;
  252.         return $this;
  253.     }
  254.     public function getCreatedAt(): ?\DateTimeInterface
  255.     {
  256.         return $this->createdAt;
  257.     }
  258.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  259.     {
  260.         $this->createdAt $createdAt;
  261.         return $this;
  262.     }
  263. }