<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity (repositoryClass="App\Repository\DiaporamaRepository")
*/
class Diaporama
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Selection", inversedBy="diaporamas")
*/
private $selection;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="diaporamasStartSortOne", cascade={"persist"})
*/
private $startSortOne;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="diaporamasStartSortTwo", cascade={"persist"})
*/
private $startSortTwo;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="diaporamasStartSortThree", cascade={"persist"})
*/
private $startSortThree;
/**
* @ORM\OneToMany(targetEntity="App\Entity\DiaporamaBlock", mappedBy="diaporama", cascade={"persist","remove"})
*/
private $blocks;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DiaporamaTemplate", inversedBy="diaporamas")
*/
private $diaporamaTemplate;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="diaporamas")
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="diaporamas")
*/
private $entity;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="diaporama")
*/
private $tags;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $state;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\Annonce", mappedBy="diaporama", cascade={"persist"})
* @ORM\OrderBy({"id" = "ASC"})
*/
private $annonces;
/**
* @ORM\Column(type="string", length=255, options={"default" : "NONE"})
*/
private $duplicateProductsBy = 'NONE';
/**
* @ORM\Column(type="string", length=2023, nullable=true)
*/
private $parameters;
public function __construct()
{
$this->blocks = new ArrayCollection();
$this->tags = new ArrayCollection();
$this->annonces = new ArrayCollection();
}
public function getId() : ?int
{
return $this->id;
}
public function getName() : ?string
{
return $this->name;
}
public function setName(?string $name) : self
{
$this->name = $name;
return $this;
}
public function getSelection() : ?Selection
{
return $this->selection;
}
public function setSelection(?Selection $selection) : self
{
$this->selection = $selection;
return $this;
}
public function getStartSortOne() : ?WebSort
{
return $this->startSortOne;
}
public function setStartSortOne(?WebSort $startSortOne) : self
{
$this->startSortOne = $startSortOne;
return $this;
}
public function getStartSortTwo() : ?WebSort
{
return $this->startSortTwo;
}
public function setStartSortTwo(?WebSort $startSortTwo) : self
{
$this->startSortTwo = $startSortTwo;
return $this;
}
public function getStartSortThree() : ?WebSort
{
return $this->startSortThree;
}
public function setStartSortThree(?WebSort $startSortThree) : self
{
$this->startSortThree = $startSortThree;
return $this;
}
/**
* @return Collection|DiaporamaBlock[]
*/
public function getBlocks() : Collection
{
return $this->blocks;
}
public function addBlock(DiaporamaBlock $block) : self
{
if (!$this->blocks->contains($block)) {
$this->blocks[] = $block;
$block->setDiaporama($this);
}
return $this;
}
public function removeBlock(DiaporamaBlock $block) : self
{
if ($this->blocks->contains($block)) {
$this->blocks->removeElement($block);
// set the owning side to null (unless already changed)
if ($block->getDiaporamaList() === $this) {
$block->setDiaporamaList(null);
}
}
return $this;
}
public function getOwner() : ?User
{
return $this->owner;
}
public function setOwner(?User $owner) : self
{
$this->owner = $owner;
return $this;
}
public function getEntity() : ?DnsitEntity
{
return $this->entity;
}
public function setEntity(?DnsitEntity $entity) : self
{
$this->entity = $entity;
return $this;
}
/**
* @return Collection|Tag[]
*/
public function getTags() : Collection
{
return $this->tags;
}
public function addTag(Tag $tag) : self
{
if (!$this->tags->contains($tag)) {
$this->tags[] = $tag;
}
return $this;
}
public function removeTag(Tag $tag) : self
{
if ($this->tags->contains($tag)) {
$this->tags->removeElement($tag);
}
return $this;
}
public function getCreatedAt() : ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt) : self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt() : ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getState() : ?int
{
return $this->state;
}
public function setState(?int $state) : self
{
$this->state = $state;
return $this;
}
/**
* @return Collection|Annonce[]
*/
public function getAnnonces(): Collection
{
return $this->annonces;
}public function addAnnonce(Annonce $annonce): self
{
if (!$this->annonces->contains($annonce)) {
$this->annonces[] = $annonce;
$annonce->setDiaporama($this);
}
return $this;
}
public function removeAnnonce(Annonce $annonce): self
{
if ($this->annonces->contains($annonce)) {
$this->annonces->removeElement($annonce);
// set the owning side to null (unless already changed)
if ($annonce->getDiaporama() === $this) {
$annonce->setDiaporama(null);
}
}
return $this;
}
public function getDiaporamaTemplate() : ?DiaporamaTemplate
{
return $this->diaporamaTemplate;
}
public function setDiaporamaTemplate(?DiaporamaTemplate $diaporamaTemplate) : self
{
$this->diaporamaTemplate = $diaporamaTemplate;
return $this;
}
public function getDuplicateProductsBy() : ?string
{
return $this->duplicateProductsBy;
}
public function setDuplicateProductsBy(?string $duplicateProductsBy) : self
{
$this->duplicateProductsBy = $duplicateProductsBy;
return $this;
}
public function getParameters() : ?string
{
return $this->parameters;
}
public function setParameters(?string $parameters) : self
{
$this->parameters = $parameters;
return $this;
}
}