<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\Actuv2JournalRepository;
use Symfony\Component\Validator\Constraints\Date;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\HttpFoundation\File\File;
/**
* Actuv2Journal
*
* @Vich\Uploadable
*/
#[ORM\Table(name: 'actuv2_journal')]
#[ORM\Entity(repositoryClass: Actuv2JournalRepository::class)]
class Actuv2Journal
{
/**
* @var int
*
*/
#[ORM\Column(name: 'id', type: 'bigint', nullable: false)]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
/**
* @var string
*
*/
#[ORM\Column(name: 'titre', type: 'string', length: 255, nullable: false)]
private $titre = '';
#[ORM\Column(name: 'video', type: 'text', nullable: true, options: ['length' => 0], columnDefinition: 'LONGTEXT')]
private $video = '';
/**
* @var \DateTime|null
*
*/
#[ORM\Column(name: 'date', type: 'date', nullable: true, options: ['comment' => 'période'])]
private $date;
/**
* @var string
*
*/
#[ORM\Column(name: 'image', type: 'string', length: 255, nullable: true, options: ['comment' => 'Image du mail, largeur 600px'])]
private $image = '';
/**
* @Vich\UploadableField(mapping="actuv2journal", fileNameProperty="image")
* @var File|null
*/
private $tmpImage = null;
#[ORM\Column(type: 'datetime', nullable: true)]
private $updatedAt;
public function getId(): ?string
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getVideo(): ?string
{
return $this->video;
}
public function setVideo(string $video): self
{
$this->video = $video;
return $this;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(?\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = is_null($image) ? "" : $image;
return $this;
}
public function setTmpImage(?File $tmpImage = null): void
{
$this->tmpImage = $tmpImage;
$this->updatedAt = new \DateTime('now');
}
public function getTmpImage(): ?File
{
return $this->tmpImage;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
}