<?php
namespace App\Entity\Webfactory\Widget\Classique;
use App\Entity\Image\Image;
use App\Entity\Webfactory\WebfactoryPage;
use App\Entity\Webfactory\Widget\WidgetAbstract;
use App\Repository\Webfactory\Widget\Classique\GalleryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Table('widget_gallery_classique')]
#[ORM\Entity(repositoryClass: GalleryRepository::class)]
class Gallery extends WidgetAbstract
{
#[ORM\Column(type: 'datetime_immutable')]
private $created_at;
#[ORM\JoinTable(name: 'widget_gallery_images_classique')]
#[ORM\ManyToMany(targetEntity: Image::class, inversedBy: 'galleries')]
private $images;
#[ORM\Column(length: 255, nullable: true)]
private ?string $typeAffichagePhotos = null;
#[ORM\Column(nullable: true)]
private ?int $sliderSlideToShow = null;
public function __construct(){
$this->created_at = new \DateTimeImmutable("now");
$this->images = new ArrayCollection();
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
/**
* @return Collection|Image[]
*/
public function getImages(): Collection
{
return $this->images;
}
public function addImage(Image $image): self
{
if (!$this->images->contains($image)) {
$this->images[] = $image;
}
return $this;
}
public function removeImage(Image $image): self
{
$this->images->removeElement($image);
return $this;
}
public function getTypeAffichagePhotos(): ?string
{
return $this->typeAffichagePhotos;
}
public function setTypeAffichagePhotos(?string $typeAffichagePhotos): static
{
$this->typeAffichagePhotos = $typeAffichagePhotos;
return $this;
}
public function getSliderSlideToShow(): ?int
{
return $this->sliderSlideToShow;
}
public function setSliderSlideToShow(?int $sliderSlideToShow): static
{
$this->sliderSlideToShow = $sliderSlideToShow;
return $this;
}
}