src/Entity/CandidateFile.php line 13
<?php
namespace App\Entity;
use App\Repository\CandidateFileRepository;
use Doctrine\ORM\Mapping as ORM;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\HttpFoundation\File\File;
#[ORM\Entity(repositoryClass: CandidateFileRepository::class)]
#[Vich\Uploadable]
class CandidateFile
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[Vich\UploadableField(mapping: 'candidate_file', fileNameProperty: 'fileName')]
private ?File $dataFile = null;
#[ORM\Column(length: 255)]
private ?string $fileName = null;
#[ORM\Column]
private ?bool $isVideo = null;
#[ORM\ManyToOne(inversedBy: 'files')]
private ?Candidate $candidate = null;
#[ORM\ManyToOne(inversedBy: 'files')]
private ?Groupe $groupe = null;
#[ORM\ManyToOne(inversedBy: 'files')]
private ?Company $company = null;
public function __construct()
{
$this->isVideo = false;
}
public function getId(): ?int
{
return $this->id;
}
public function isIsVideo(): ?bool
{
return $this->isVideo;
}
public function setIsVideo(bool $isVideo): self
{
$this->isVideo = $isVideo;
return $this;
}
/**
* If manually uploading a file (i.e. not using Symfony Form) ensure an instance
* of 'UploadedFile' is injected into this setter to trigger the update. If this
* bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
* must be able to accept an instance of 'CandidateFile' as the bundle will inject one here
* during Doctrine hydration.
*
* @param CandidateFile|\Symfony\Component\HttpFoundation\File\UploadedFile|null $imageFile
*/
public function setDataFile(?File $dataFile = null): void
{
$this->dataFile = $dataFile;
}
public function getDataFile(): ?File
{
return $this->dataFile;
}
/**
* @return string|null
*/
public function getFileName(): ?string
{
return $this->fileName;
}
/**
* @param string|null $fileName
*/
public function setFileName(?string $fileName): void
{
$this->fileName = $fileName;
}
public function getCandidate(): ?Candidate
{
return $this->candidate;
}
public function setCandidate(?Candidate $candidate): self
{
$this->candidate = $candidate;
return $this;
}
public function getGroupe(): ?Groupe
{
return $this->groupe;
}
public function setGroupe(?Groupe $groupe): self
{
$this->groupe = $groupe;
return $this;
}
public function getCompany(): ?Company
{
return $this->company;
}
public function setCompany(?Company $company): self
{
$this->company = $company;
return $this;
}
}