<?php
namespace App\Entity;
use App\Repository\TemoignageRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: TemoignageRepository::class)]
#[Vich\Uploadable]
class Temoignage
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $beneficiaire = null;
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?\DateTimeInterface $date = null;
#[ORM\Column(type:'string', length:255, nullable: true)]
private ?string $video = null;
#[ORM\Column(type: Types::TEXT), ]
private ?string $url = "";
#[ORM\Column(type: Types::TEXT)]
private ?string $videoType = "";
#[ORM\Column(length: 255, nullable:true)]
private ?string $type = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $description = null;
#[ORM\Column(type:'string', length:255, nullable:true)]
private $image;
#[Vich\UploadableField(mapping:'post_thumbnails', fileNameProperty:'image')]
private $imageFile;
#[Vich\UploadableField(mapping:'post_thumbnails', fileNameProperty:'video')]
private $videoFile;
public function getId(): ?int
{
return $this->id;
}
public function getBeneficiaire(): ?string
{
return $this->beneficiaire;
}
public function setBeneficiaire(string $beneficiaire): self
{
$this->beneficiaire = $beneficiaire;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getVideo(): ?string
{
return $this->video;
}
public function setVideo(?string $video): ?self
{
$this->video = $video;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): self
{
$this->type = $type;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function setImageFile(File $image = null)
{
$this->imageFile = $image;
// 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 ($image) {
// if 'updatedAt' is not defined in your entity, use another property
// $this->updatedAt = new \DateTime('now');
// }
}
public function getImageFile()
{
return $this->imageFile;
}
public function setVideoFile(File $video = null)
{
$this->videoFile = $video;
// 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 ($image) {
// if 'updatedAt' is not defined in your entity, use another property
// $this->updatedAt = new \DateTime('now');
// }
}
public function getVideoFile()
{
return $this->videoFile;
}
public function setImage($image)
{
$this->image = $image;
}
public function getImage()
{
return $this->image;
}
public function setUrl(?string $url = null)
{
$this->url = $url;
}
public function getUrl()
{
return $this->url;
}
public function setVideoType(?string $videoType)
{
$this->videoType = $videoType;
}
public function getVideoType()
{
return $this->videoType;
}
}