<?php
namespace App\Entity;
use App\Repository\JobOfferCandidacyRepository;
use Cofondateur\SocleTechniqueBundle\Annotation\CrudField;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Vich\UploaderBundle\Mapping\Annotation\Uploadable;
use App\Form\JobOfferCandidacyFileFormType;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=JobOfferCandidacyRepository::class)
* @Vich\Uploadable
* @Uploadable()
*/
class JobOfferCandidacy
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @CrudField(index=true, label="Nom")
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
* @CrudField(label="Prénom")
*/
private $firstname;
/**
* @ORM\Column(type="string", length=255)
* @CrudField(label="Email")
*/
private $email;
/**
* @ORM\Column(type="string", length=255)
* @CrudField(index=true, label="Téléphone")
* @Assert\Regex(
* pattern="/^0[1-9]([ .-]?[0-9]{2}){4}$/",
* message="Le numéro de téléphone doit être au format français."
* )
*/
private $phone;
/**
* @ORM\Column(type="text")
* @CrudField(label="Message")
*/
private $message;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $cvName;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $cvSize;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $cvUpdatedAt;
/**
* @Vich\UploadableField(mapping="default", fileNameProperty="cvName", size="cvSize")
* @CrudField(label="CV", imagePreview=false)
*/
private $cvFile;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $lmName;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $lmSize;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $lmUpdatedAt;
/**
* @Vich\UploadableField(mapping="default", fileNameProperty="lmName", size="lmSize")
* @CrudField(label="Lettre de motivation", imagePreview=false)
*/
private $lmFile;
/**
* @ORM\ManyToOne(targetEntity=JobOffer::class, inversedBy="jobOfferCandidacies")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
* @CrudField(label="Offre d'emploi", index=true)
*/
private $jobOffer;
/**
* @ORM\Column(type="boolean")
* @CrudField(label="J'accepte la politique de confidentialité")
*/
private $confidentiality;
/**
* @ORM\Column(type="date")
* @CrudField(index=true, label="Date de soumission")
*/
private $createdAt;
public function __toString(): string
{
return $this->getId() ?? "N/A";
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getFirstname(): ?string
{
return $this->firstname;
}
public function setFirstname(string $firstname): self
{
$this->firstname = $firstname;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getMessage(): ?string
{
return $this->message;
}
public function setMessage(string $message): self
{
$this->message = $message;
return $this;
}
public function getCvName(): ?string
{
return $this->cvName;
}
public function setCvName(?string $cvName): self
{
$this->cvName = $cvName;
return $this;
}
public function getCvSize(): ?int
{
return $this->cvSize;
}
public function setCvSize(?int $cvSize): self
{
$this->cvSize = $cvSize;
return $this;
}
public function getCvUpdatedAt(): ?\DateTimeInterface
{
return $this->cvUpdatedAt;
}
public function setCvUpdatedAt(?\DateTimeInterface $cvUpdatedAt): self
{
$this->cvUpdatedAt = $cvUpdatedAt;
return $this;
}
public function getCvFile(): ?File
{
return $this->cvFile;
}
public function setCvFile(?File $cvFile): self
{
$this->cvFile = $cvFile;
if (null !== $this->cvFile) {
$this->cvUpdatedAt = new \DateTimeImmutable();
}
return $this;
}
public function getLmName(): ?string
{
return $this->lmName;
}
public function setLmName(?string $lmName): self
{
$this->lmName = $lmName;
return $this;
}
public function getLmSize(): ?int
{
return $this->lmSize;
}
public function setLmSize(?int $lmSize): self
{
$this->lmSize = $lmSize;
return $this;
}
public function getLmUpdatedAt(): ?\DateTimeInterface
{
return $this->lmUpdatedAt;
}
public function setLmUpdatedAt(?\DateTimeInterface $lmUpdatedAt): self
{
$this->lmUpdatedAt = $lmUpdatedAt;
return $this;
}
public function getLmFile(): ?File
{
return $this->lmFile;
}
public function setLmFile(?File $lmFile): self
{
$this->lmFile = $lmFile;
if (null !== $this->lmFile) {
$this->lmUpdatedAt = new \DateTimeImmutable();
}
return $this;
}
public function getJobOffer(): ?jobOffer
{
return $this->jobOffer;
}
public function setJobOffer(?jobOffer $jobOffer): self
{
$this->jobOffer = $jobOffer;
return $this;
}
public function isConfidentiality(): ?bool
{
return $this->confidentiality;
}
public function setConfidentiality(bool $confidentiality): self
{
$this->confidentiality = $confidentiality;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
}