<?php
declare(strict_types=1);
namespace App\Entity;
use App\Repository\SlideRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=SlideRepository::class)
* @ORM\Table(name="sulu_manual_carousel_slides")
* @ORM\HasLifecycleCallbacks()
*/
class Slide
{
public const DISTRIBUTION_MODE_ALL = 'ALL';
public const DISTRIBUTION_MODE_INCLUDE = 'INCLUDE';
public const DISTRIBUTION_MODE_ALL_EXCEPT = 'ALL_EXCEPT';
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private ?int $id = null;
/**
* Titre du slide (remplace le titre du carousel)
* @ORM\Column(type="string", length=255)
*/
private string $title = '';
/**
* Type de carousel (hero_section, carousel01, etc.)
* @ORM\Column(type="string", length=50, nullable=true)
*/
private ?string $type = null;
/**
* @ORM\Column(type="integer")
*/
private int $position = 0;
/**
* @ORM\Column(type="boolean")
*/
private bool $active = true;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTimeInterface $startAt = null;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private ?\DateTimeInterface $endAt = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $subtitle = null;
/**
* @ORM\Column(type="string", nullable=true)
*/
private ?string $mediaUrl = null;
/**
* @ORM\Column(type="boolean", options={"default": false})
*/
private bool $isVideo = false;
/**
* @ORM\Column(type="json", nullable=true)
*/
private ?array $ctas = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $offerId = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $companyId = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $offerLabelCache = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private ?string $companyLabelCache = null;
/**
* @ORM\Column(type="json", nullable=true)
*/
private ?array $offerPayloadCache = null;
/**
* @ORM\Column(type="json", nullable=true)
*/
private ?array $companyPayloadCache = null;
/**
* @ORM\Column(type="json", nullable=true)
*/
private ?array $elements = null;
/**
* Mode de distribution sur les webspaces
* @ORM\Column(type="string", length=20)
*/
private string $distributionMode = self::DISTRIBUTION_MODE_ALL;
/**
* Liste des webspaces à inclure (si mode INCLUDE)
* @ORM\Column(type="json", nullable=true)
*/
private ?array $includeWebspaces = null;
/**
* Liste des webspaces à exclure (si mode ALL_EXCEPT)
* @ORM\Column(type="json", nullable=true)
*/
private ?array $excludeWebspaces = null;
/**
* Exclure du site grand public (main-website)
* @ORM\Column(type="boolean", options={"default": false})
*/
private bool $isNotMainWebspace = false;
/**
* Propriétés de style (dégradé de couleur, filtre de fond, etc.)
* @ORM\Column(type="json", nullable=true)
*/
private ?array $styles = null;
/**
* Contenu pour la page liste (title, short_desc, long_desc)
* @ORM\Column(type="json", nullable=true)
*/
private ?array $listPageContent = null;
/**
* @ORM\Column(type="datetime")
*/
private ?\DateTimeInterface $created = null;
/**
* @ORM\Column(type="datetime")
*/
private ?\DateTimeInterface $updated = null;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getPosition(): int
{
return $this->position;
}
public function setPosition(int $position): self
{
$this->position = $position;
return $this;
}
public function isActive(): bool
{
return $this->active;
}
public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}
public function getStartAt(): ?\DateTimeInterface
{
return $this->startAt;
}
public function setStartAt(?\DateTimeInterface $startAt): self
{
$this->startAt = $startAt;
return $this;
}
public function getEndAt(): ?\DateTimeInterface
{
return $this->endAt;
}
public function setEndAt(?\DateTimeInterface $endAt): self
{
$this->endAt = $endAt;
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(?string $subtitle): self
{
$this->subtitle = $subtitle;
return $this;
}
public function getMediaUrl(): ?string
{
return $this->mediaUrl;
}
public function setMediaUrl(?string $mediaUrl): self
{
$this->mediaUrl = $mediaUrl;
return $this;
}
public function isVideo(): bool
{
return $this->isVideo;
}
public function setIsVideo(bool $isVideo): self
{
$this->isVideo = $isVideo;
return $this;
}
public function getCompanyId(): ?string
{
return $this->companyId;
}
public function setCompanyId(?string $companyId): self
{
$this->companyId = $companyId;
return $this;
}
public function getCtas(): ?array
{
return $this->ctas;
}
public function setCtas(?array $ctas): self
{
$this->ctas = $ctas;
return $this;
}
public function getOfferId(): ?string
{
return $this->offerId;
}
public function setOfferId(?string $offerId): self
{
$this->offerId = $offerId;
return $this;
}
public function getOfferLabelCache(): ?string
{
return $this->offerLabelCache;
}
public function setOfferLabelCache(?string $offerLabelCache): self
{
$this->offerLabelCache = $offerLabelCache;
return $this;
}
public function getCompanyLabelCache(): ?string
{
return $this->companyLabelCache;
}
public function setCompanyLabelCache(?string $companyLabelCache): self
{
$this->companyLabelCache = $companyLabelCache;
return $this;
}
public function getOfferPayloadCache(): ?array
{
return $this->offerPayloadCache;
}
public function setOfferPayloadCache(?array $offerPayloadCache): self
{
$this->offerPayloadCache = $offerPayloadCache;
return $this;
}
public function getCompanyPayloadCache(): ?array
{
return $this->companyPayloadCache;
}
public function setCompanyPayloadCache(?array $companyPayloadCache): self
{
$this->companyPayloadCache = $companyPayloadCache;
return $this;
}
public function getElements(): ?array
{
return $this->elements;
}
public function setElements(?array $elements): self
{
$this->elements = $elements;
return $this;
}
public function getDistributionMode(): string
{
return $this->distributionMode;
}
public function setDistributionMode(string $distributionMode): self
{
$this->distributionMode = $distributionMode;
return $this;
}
public function getIncludeWebspaces(): ?array
{
return $this->includeWebspaces;
}
public function setIncludeWebspaces(?array $includeWebspaces): self
{
$this->includeWebspaces = $includeWebspaces;
return $this;
}
public function getExcludeWebspaces(): ?array
{
return $this->excludeWebspaces;
}
public function setExcludeWebspaces(?array $excludeWebspaces): self
{
$this->excludeWebspaces = $excludeWebspaces;
return $this;
}
public function isNotMainWebspace(): bool
{
return $this->isNotMainWebspace;
}
public function setIsNotMainWebspace(bool $isNotMainWebspace): self
{
$this->isNotMainWebspace = $isNotMainWebspace;
return $this;
}
public function getStyles(): ?array
{
return $this->styles;
}
public function setStyles(?array $styles): self
{
$this->styles = $styles;
return $this;
}
public function getListPageContent(): ?array
{
return $this->listPageContent;
}
public function setListPageContent(?array $listPageContent): self
{
$this->listPageContent = $listPageContent;
return $this;
}
public function getCreated(): ?\DateTimeInterface
{
return $this->created;
}
public function setCreated(\DateTimeInterface $created): self
{
$this->created = $created;
return $this;
}
public function getUpdated(): ?\DateTimeInterface
{
return $this->updated;
}
public function setUpdated(\DateTimeInterface $updated): self
{
$this->updated = $updated;
return $this;
}
/**
* @ORM\PrePersist
*/
public function onPrePersist(): void
{
$now = new \DateTime();
$this->created = $now;
$this->updated = $now;
}
/**
* @ORM\PreUpdate
*/
public function onPreUpdate(): void
{
$this->updated = new \DateTime();
}
}