src/Entity/CandidateFile.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CandidateFileRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. #[ORM\Entity(repositoryClassCandidateFileRepository::class)]
  8. #[Vich\Uploadable]
  9. class CandidateFile
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[Vich\UploadableField(mapping'candidate_file'fileNameProperty'fileName')]
  16.     private ?File $dataFile null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $fileName null;
  19.     #[ORM\Column]
  20.     private ?bool $isVideo null;
  21.     #[ORM\ManyToOne(inversedBy'files')]
  22.     private ?Candidate $candidate null;
  23.     #[ORM\ManyToOne(inversedBy'files')]
  24.     private ?Groupe $groupe null;
  25.     #[ORM\ManyToOne(inversedBy'files')]
  26.     private ?Company $company null;
  27.     public function __construct()
  28.     {
  29.         $this->isVideo false;
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function isIsVideo(): ?bool
  36.     {
  37.         return $this->isVideo;
  38.     }
  39.     public function setIsVideo(bool $isVideo): self
  40.     {
  41.         $this->isVideo $isVideo;
  42.         return $this;
  43.     }
  44.     /**
  45.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  46.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  47.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  48.      * must be able to accept an instance of 'CandidateFile' as the bundle will inject one here
  49.      * during Doctrine hydration.
  50.      *
  51.      * @param CandidateFile|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
  52.      */
  53.     public function setDataFile(?File $dataFile null): void
  54.     {
  55.         $this->dataFile $dataFile;
  56.     }
  57.     public function getDataFile(): ?File
  58.     {
  59.         return $this->dataFile;
  60.     }
  61.     /**
  62.      * @return string|null
  63.      */
  64.     public function getFileName(): ?string
  65.     {
  66.         return $this->fileName;
  67.     }
  68.     /**
  69.      * @param string|null $fileName
  70.      */
  71.     public function setFileName(?string $fileName): void
  72.     {
  73.         $this->fileName $fileName;
  74.     }
  75.     public function getCandidate(): ?Candidate
  76.     {
  77.         return $this->candidate;
  78.     }
  79.     public function setCandidate(?Candidate $candidate): self
  80.     {
  81.         $this->candidate $candidate;
  82.         return $this;
  83.     }
  84.     public function getGroupe(): ?Groupe
  85.     {
  86.         return $this->groupe;
  87.     }
  88.     public function setGroupe(?Groupe $groupe): self
  89.     {
  90.         $this->groupe $groupe;
  91.         return $this;
  92.     }
  93.     public function getCompany(): ?Company
  94.     {
  95.         return $this->company;
  96.     }
  97.     public function setCompany(?Company $company): self
  98.     {
  99.         $this->company $company;
  100.         return $this;
  101.     }
  102. }