src/Entity/PhotoGalery.php line 15
<?phpnamespace App\Entity;use App\Repository\PhotoGaleryRepository;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Vich\UploaderBundle\Mapping\Annotation as Vich;use Symfony\Component\Validator\Constraints as Assert;use Symfony\Component\HttpFoundation\File\File;use Symfony\Component\HttpFoundation\File\UploadedFile;#[ORM\Entity(repositoryClass: PhotoGaleryRepository::class)]#[Vich\Uploadable]class PhotoGalery{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $title = null;#[ORM\Column(length: 255, nullable: true)]private ?string $filename = null;#[Vich\UploadableField(mapping: "photoGalery", fileNameProperty: "filename")]#[Assert\Image(mimeTypes: ['image/jpeg', 'image/png', 'image/jpg', 'image/gif'],mimeTypesMessage: "Les formats d'images acceptés sont : .jpeg .png .jpg and .gif")]private ?File $imageFile = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $createdAt = null;#[ORM\Column(type: Types::DATETIME_MUTABLE)]private ?\DateTimeInterface $updatedAt = null;#[ORM\ManyToOne(inversedBy: 'photoGaleries')]private ?AlbumPhoto $album = null;public function __construct(){$this->createdAt = new \DateTime('now');$this->updatedAt = new \DateTime('now');}public function getId(): ?int{return $this->id;}public function getTitle(): ?string{return $this->title;}public function setTitle(string $title): static{$this->title = $title;return $this;}public function getFilename(): ?string{return $this->filename;}public function setFilename(?string $filename): static{$this->filename = $filename;return $this;}/*** @return null|File*/public function getImageFile(): ?File{return $this->imageFile;}/*** @param null|File $imageFile* @return PhotoGalery*/public function setImageFile(?File $imageFile): self{$this->imageFile = $imageFile;if ($this->imageFile instanceof UploadedFile) {$this->updatedAt = new \DateTime('now');}return $this;}public function getCreatedAt(): ?\DateTimeInterface{return $this->createdAt;}public function setCreatedAt(\DateTimeInterface $createdAt): static{$this->createdAt = $createdAt;return $this;}public function getUpdatedAt(): ?\DateTimeInterface{return $this->updatedAt;}public function setUpdatedAt(\DateTimeInterface $updatedAt): static{$this->updatedAt = $updatedAt;return $this;}public function getAlbum(): ?AlbumPhoto{return $this->album;}public function setAlbum(?AlbumPhoto $album): static{$this->album = $album;return $this;}}