src/Entity/Diaporama.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity (repositoryClass="App\Repository\DiaporamaRepository")
  8.  */
  9. class Diaporama
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true)
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity="App\Entity\Selection", inversedBy="diaporamas")
  23.      */
  24.     private $selection;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="diaporamasStartSortOne", cascade={"persist"})
  27.      */
  28.     private $startSortOne;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="diaporamasStartSortTwo", cascade={"persist"})
  31.      */
  32.     private $startSortTwo;
  33.     /**
  34.      * @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="diaporamasStartSortThree", cascade={"persist"})
  35.      */
  36.     private $startSortThree;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity="App\Entity\DiaporamaBlock", mappedBy="diaporama", cascade={"persist","remove"})
  39.      */
  40.     private $blocks;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity="App\Entity\DiaporamaTemplate", inversedBy="diaporamas")
  43.      */
  44.     private $diaporamaTemplate;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="diaporamas")
  47.      */
  48.     private $owner;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="diaporamas")
  51.      */
  52.     private $entity;
  53.     /**
  54.      * @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="diaporama")
  55.      */
  56.     private $tags;
  57.     /**
  58.      * @ORM\Column(type="datetime", nullable=true)
  59.      */
  60.     private $createdAt;
  61.     /**
  62.      * @ORM\Column(type="datetime", nullable=true)
  63.      */
  64.     private $updatedAt;
  65.     /**
  66.      * @ORM\Column(type="integer", nullable=true)
  67.      */
  68.     private $state;
  69.     /**
  70.      * @var \Doctrine\Common\Collections\Collection
  71.      *
  72.      * @ORM\OneToMany(targetEntity="App\Entity\Annonce", mappedBy="diaporama", cascade={"persist"})
  73.      * @ORM\OrderBy({"id" = "ASC"})
  74.      */
  75.     private $annonces;
  76.     /**
  77.      * @ORM\Column(type="string", length=255, options={"default" : "NONE"})
  78.      */
  79.     private $duplicateProductsBy 'NONE';
  80.     /**
  81.      * @ORM\Column(type="string", length=2023, nullable=true)
  82.      */
  83.     private $parameters;
  84.     public function __construct()
  85.     {
  86.         $this->blocks = new ArrayCollection();
  87.         $this->tags = new ArrayCollection();
  88.         $this->annonces = new ArrayCollection();
  89.     }
  90.     public function getId() : ?int
  91.     {
  92.         return $this->id;
  93.     }
  94.     public function getName() : ?string
  95.     {
  96.         return $this->name;
  97.     }
  98.     public function setName(?string $name) : self
  99.     {
  100.         $this->name $name;
  101.         return $this;
  102.     }
  103.     public function getSelection() : ?Selection
  104.     {
  105.         return $this->selection;
  106.     }
  107.     public function setSelection(?Selection $selection) : self
  108.     {
  109.         $this->selection $selection;
  110.         return $this;
  111.     }
  112.     public function getStartSortOne() : ?WebSort
  113.     {
  114.         return $this->startSortOne;
  115.     }
  116.     public function setStartSortOne(?WebSort $startSortOne) : self
  117.     {
  118.         $this->startSortOne $startSortOne;
  119.         return $this;
  120.     }
  121.     public function getStartSortTwo() : ?WebSort
  122.     {
  123.         return $this->startSortTwo;
  124.     }
  125.     public function setStartSortTwo(?WebSort $startSortTwo) : self
  126.     {
  127.         $this->startSortTwo $startSortTwo;
  128.         return $this;
  129.     }
  130.     public function getStartSortThree() : ?WebSort
  131.     {
  132.         return $this->startSortThree;
  133.     }
  134.     public function setStartSortThree(?WebSort $startSortThree) : self
  135.     {
  136.         $this->startSortThree $startSortThree;
  137.         return $this;
  138.     }
  139.     /**
  140.      * @return Collection|DiaporamaBlock[]
  141.      */
  142.     public function getBlocks() : Collection
  143.     {
  144.         return $this->blocks;
  145.     }
  146.     public function addBlock(DiaporamaBlock $block) : self
  147.     {
  148.         if (!$this->blocks->contains($block)) {
  149.             $this->blocks[] = $block;
  150.             $block->setDiaporama($this);
  151.         }
  152.         return $this;
  153.     }
  154.     public function removeBlock(DiaporamaBlock $block) : self
  155.     {
  156.         if ($this->blocks->contains($block)) {
  157.             $this->blocks->removeElement($block);
  158.             // set the owning side to null (unless already changed)
  159.             if ($block->getDiaporamaList() === $this) {
  160.                 $block->setDiaporamaList(null);
  161.             }
  162.         }
  163.         return $this;
  164.     }
  165.     public function getOwner() : ?User
  166.     {
  167.         return $this->owner;
  168.     }
  169.     public function setOwner(?User $owner) : self
  170.     {
  171.         $this->owner $owner;
  172.         return $this;
  173.     }
  174.     public function getEntity() : ?DnsitEntity
  175.     {
  176.         return $this->entity;
  177.     }
  178.     public function setEntity(?DnsitEntity $entity) : self
  179.     {
  180.         $this->entity $entity;
  181.         return $this;
  182.     }
  183.     /**
  184.      * @return Collection|Tag[]
  185.      */
  186.     public function getTags() : Collection
  187.     {
  188.         return $this->tags;
  189.     }
  190.     public function addTag(Tag $tag) : self
  191.     {
  192.         if (!$this->tags->contains($tag)) {
  193.             $this->tags[] = $tag;
  194.         }
  195.         return $this;
  196.     }
  197.     public function removeTag(Tag $tag) : self
  198.     {
  199.         if ($this->tags->contains($tag)) {
  200.             $this->tags->removeElement($tag);
  201.         }
  202.         return $this;
  203.     }
  204.     public function getCreatedAt() : ?\DateTimeInterface
  205.     {
  206.         return $this->createdAt;
  207.     }
  208.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  209.     {
  210.         $this->createdAt $createdAt;
  211.         return $this;
  212.     }
  213.     public function getUpdatedAt() : ?\DateTimeInterface
  214.     {
  215.         return $this->updatedAt;
  216.     }
  217.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  218.     {
  219.         $this->updatedAt $updatedAt;
  220.         return $this;
  221.     }
  222.     public function getState() : ?int
  223.     {
  224.         return $this->state;
  225.     }
  226.     public function setState(?int $state) : self
  227.     {
  228.         $this->state $state;
  229.         return $this;
  230.     }
  231.     /**
  232.      * @return Collection|Annonce[]
  233.      */
  234.     public function getAnnonces(): Collection
  235.     {
  236.         return $this->annonces;
  237.     }public function addAnnonce(Annonce $annonce): self
  238.     {
  239.         if (!$this->annonces->contains($annonce)) {
  240.             $this->annonces[] = $annonce;
  241.             $annonce->setDiaporama($this);
  242.         }
  243.         return $this;
  244.     }
  245.     public function removeAnnonce(Annonce $annonce): self
  246.     {
  247.         if ($this->annonces->contains($annonce)) {
  248.             $this->annonces->removeElement($annonce);
  249.             // set the owning side to null (unless already changed)
  250.             if ($annonce->getDiaporama() === $this) {
  251.                 $annonce->setDiaporama(null);
  252.             }
  253.         }
  254.         return $this;
  255.     }
  256.     public function getDiaporamaTemplate() : ?DiaporamaTemplate
  257.     {
  258.         return $this->diaporamaTemplate;
  259.     }
  260.     public function setDiaporamaTemplate(?DiaporamaTemplate $diaporamaTemplate) : self
  261.     {
  262.         $this->diaporamaTemplate $diaporamaTemplate;
  263.         return $this;
  264.     }
  265.     public function getDuplicateProductsBy() : ?string
  266.     {
  267.         return $this->duplicateProductsBy;
  268.     }
  269.     public function setDuplicateProductsBy(?string $duplicateProductsBy) : self
  270.     {
  271.         $this->duplicateProductsBy $duplicateProductsBy;
  272.         return $this;
  273.     }
  274.     public function getParameters() : ?string
  275.     {
  276.         return $this->parameters;
  277.     }
  278.     public function setParameters(?string $parameters) : self
  279.     {
  280.         $this->parameters $parameters;
  281.         return $this;
  282.     }
  283. }