<?php
namespace App\Entity;
use App\Repository\Actuv2InfographieRseCarouselMobileFileRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @Vich\Uploadable
*/
#[ORM\Entity(repositoryClass: Actuv2InfographieRseCarouselMobileFileRepository::class)]
class Actuv2InfographieRseCarouselMobileFile
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $fileName = null;
/**
* @Vich\UploadableField(mapping="actuv2_infographie_rse_file", fileNameProperty="fileName")
* @var File
*/
private $file;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $fileNameWebp = null;
/**
* @Vich\UploadableField(mapping="actuv2_infographie_rse_file", fileNameProperty="fileNameWebp")
* @var File
*/
private $fileWebp;
#[ORM\ManyToOne(targetEntity: Actuv2InfographieRse::class, inversedBy: 'actuv2InfographieRseCarouselMobileFiles')]
private $actuv2InfographieRse;
#[ORM\Column(type: 'datetime')]
private $updatedAt;
#[ORM\Column(type: 'integer', options: ["default" => 0])]
private $orderDisplay;
public function getId(): ?int
{
return $this->id;
}
public function getFileNameWebp(): ?string
{
return $this->fileNameWebp;
}
public function setFileNameWebp(?string $fileNameWebp): self
{
$this->fileNameWebp = $fileNameWebp;
return $this;
}
public function setFileWebp(?File $fileWebp = null)
{
$this->fileWebp = $fileWebp;
// VERY IMPORTANT:
// It is required that at least one field changes if you are using Doctrine,
// otherwise the event listeners won't be called and the file is lost
if ($fileWebp) {
// if 'updatedAt' is not defined in your entity, use another property
$this->updatedAt = new \DateTime('now');
}
}
public function getFileWebp()
{
return $this->fileWebp;
}
public function getFileName(): ?string
{
return $this->fileName;
}
public function setFileName(?string $fileName): self
{
$this->fileName = $fileName;
return $this;
}
public function setFile(?File $file = null)
{
$this->file = $file;
// VERY IMPORTANT:
// It is required that at least one field changes if you are using Doctrine,
// otherwise the event listeners won't be called and the file is lost
if ($file) {
// if 'updatedAt' is not defined in your entity, use another property
$this->updatedAt = new \DateTime('now');
}
}
public function getFile()
{
return $this->file;
}
public function getActuv2InfographieRse(): ?Actuv2InfographieRse
{
return $this->actuv2InfographieRse;
}
public function setActuv2InfographieRse(?Actuv2InfographieRse $actuv2InfographieRse): self
{
$this->actuv2InfographieRse = $actuv2InfographieRse;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getOrderDisplay(): ?int
{
return $this->orderDisplay;
}
public function setOrderDisplay(int $orderDisplay): self
{
$this->orderDisplay = $orderDisplay;
return $this;
}
}