src/Entity/Temoignage.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TemoignageRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. #[ORM\Entity(repositoryClassTemoignageRepository::class)]
  10. #[Vich\Uploadable]
  11. class Temoignage
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $beneficiaire null;
  19.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  20.     private ?\DateTimeInterface $date null;
  21.     #[ORM\Column(type:'string'length:255nullabletrue)]
  22.     private ?string $video null;
  23.     #[ORM\Column(typeTypes::TEXT), ]
  24.     private ?string $url "";
  25.     #[ORM\Column(typeTypes::TEXT)]
  26.     private ?string $videoType "";
  27.     #[ORM\Column(length255nullable:true)]
  28.     private ?string $type null;
  29.     #[ORM\Column(typeTypes::TEXT)]
  30.     private ?string $description null;
  31.     #[ORM\Column(type:'string'length:255nullable:true)]
  32.     private $image;
  33.     #[Vich\UploadableField(mapping:'post_thumbnails'fileNameProperty:'image')]
  34.     private $imageFile;
  35.     #[Vich\UploadableField(mapping:'post_thumbnails'fileNameProperty:'video')]
  36.     private $videoFile;
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getBeneficiaire(): ?string
  42.     {
  43.         return $this->beneficiaire;
  44.     }
  45.     public function setBeneficiaire(string $beneficiaire): self
  46.     {
  47.         $this->beneficiaire $beneficiaire;
  48.         return $this;
  49.     }
  50.     public function getDate(): ?\DateTimeInterface
  51.     {
  52.         return $this->date;
  53.     }
  54.     public function setDate(\DateTimeInterface $date): self
  55.     {
  56.         $this->date $date;
  57.         return $this;
  58.     }
  59.     public function getVideo(): ?string
  60.     {
  61.         return $this->video;
  62.     }
  63.     public function setVideo(?string $video): ?self
  64.     {
  65.         $this->video $video;
  66.         return $this;
  67.     }
  68.     public function getType(): ?string
  69.     {
  70.         return $this->type;
  71.     }
  72.     public function setType(string $type): self
  73.     {
  74.         $this->type $type;
  75.         return $this;
  76.     }
  77.     public function getDescription(): ?string
  78.     {
  79.         return $this->description;
  80.     }
  81.     public function setDescription(string $description): self
  82.     {
  83.         $this->description $description;
  84.         return $this;
  85.     }
  86.     public function setImageFile(File $image null)
  87.     {
  88.         $this->imageFile $image;
  89.         // VERY IMPORTANT:
  90.         // It is required that at least one field changes if you are using Doctrine,
  91.         // otherwise the event listeners won't be called and the file is lost
  92.         //  if ($image) {
  93.         // if 'updatedAt' is not defined in your entity, use another property
  94.         // $this->updatedAt = new \DateTime('now');
  95.         // }
  96.     }
  97.     public function getImageFile()
  98.     {
  99.         return $this->imageFile;
  100.     }
  101.     public function setVideoFile(File $video null)
  102.     {
  103.         $this->videoFile $video;
  104.         // VERY IMPORTANT:
  105.         // It is required that at least one field changes if you are using Doctrine,
  106.         // otherwise the event listeners won't be called and the file is lost
  107.         //  if ($image) {
  108.         // if 'updatedAt' is not defined in your entity, use another property
  109.         // $this->updatedAt = new \DateTime('now');
  110.         // }
  111.     }
  112.     public function getVideoFile()
  113.     {
  114.         return $this->videoFile;
  115.     }
  116.     public function setImage($image)
  117.     {
  118.         $this->image $image;
  119.     }
  120.     public function getImage()
  121.     {
  122.         return $this->image;
  123.     }
  124.     public function setUrl(?string $url null)
  125.     {
  126.         $this->url $url;
  127.     }
  128.     public function getUrl()
  129.     {
  130.         return $this->url;
  131.     }
  132.     public function setVideoType(?string $videoType)
  133.     {
  134.         $this->videoType $videoType;
  135.     }
  136.     public function getVideoType()
  137.     {
  138.         return $this->videoType;
  139.     }
  140. }