src/Entity/Actuv2Journal.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Repository\Actuv2JournalRepository;
  5. use Symfony\Component\Validator\Constraints\Date;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. use Symfony\Component\HttpFoundation\File\File;
  8. /**
  9.  * Actuv2Journal
  10.  *
  11.  * @Vich\Uploadable
  12.  */
  13. #[ORM\Table(name'actuv2_journal')]
  14. #[ORM\Entity(repositoryClassActuv2JournalRepository::class)]
  15. class Actuv2Journal
  16. {
  17.     /**
  18.      * @var int
  19.      *
  20.      */
  21.     #[ORM\Column(name'id'type'bigint'nullablefalse)]
  22.     #[ORM\Id]
  23.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  24.     private $id;
  25.     /**
  26.      * @var string
  27.      *
  28.      */
  29.     #[ORM\Column(name'titre'type'string'length255nullablefalse)]
  30.     private $titre '';
  31.     #[ORM\Column(name'video'type'text'nullabletrueoptions: ['length' => 0], columnDefinition'LONGTEXT')]
  32.     private $video '';
  33.     /**
  34.      * @var \DateTime|null
  35.      *
  36.      */
  37.     #[ORM\Column(name'date'type'date'nullabletrueoptions: ['comment' => 'pĂ©riode'])]
  38.     private $date;
  39.     /**
  40.      * @var string
  41.      *
  42.      */
  43.     #[ORM\Column(name'image'type'string'length255nullabletrueoptions: ['comment' => 'Image du mail, largeur 600px'])]
  44.     private $image '';
  45.     /**
  46.      * @Vich\UploadableField(mapping="actuv2journal", fileNameProperty="image")
  47.      * @var File|null
  48.      */
  49.     private $tmpImage null;
  50.     #[ORM\Column(type'datetime'nullabletrue)]
  51.     private $updatedAt;
  52.     public function getId(): ?string
  53.     {
  54.         return $this->id;
  55.     }
  56.     public function getTitre(): ?string
  57.     {
  58.         return $this->titre;
  59.     }
  60.     public function setTitre(string $titre): self
  61.     {
  62.         $this->titre $titre;
  63.         return $this;
  64.     }
  65.     public function getVideo(): ?string
  66.     {
  67.         return $this->video;
  68.     }
  69.     public function setVideo(string $video): self
  70.     {
  71.         $this->video $video;
  72.         return $this;
  73.     }
  74.     public function getDate(): ?\DateTimeInterface
  75.     {
  76.         return $this->date;
  77.     }
  78.     public function setDate(?\DateTimeInterface $date): self
  79.     {
  80.         $this->date $date;
  81.         return $this;
  82.     }
  83.     public function getImage(): ?string
  84.     {
  85.         return $this->image;
  86.     }
  87.     public function setImage(?string $image): self
  88.     {
  89.         $this->image is_null($image) ? "" $image;
  90.         return $this;
  91.     }
  92.     public function setTmpImage(?File $tmpImage null): void
  93.     {
  94.         $this->tmpImage $tmpImage;
  95.         $this->updatedAt = new \DateTime('now');
  96.     }
  97.     public function getTmpImage(): ?File
  98.     {
  99.         return $this->tmpImage;
  100.     }
  101.     public function getUpdatedAt(): ?\DateTimeInterface
  102.     {
  103.         return $this->updatedAt;
  104.     }
  105.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  106.     {
  107.         $this->updatedAt $updatedAt;
  108.         return $this;
  109.     }
  110. }