src/AppBundle/Entity/PageDefault.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Core\Entity\Traits\EntityTrait;
  4. use Core\Entity\Traits\PageTrait;
  5. use Core\Entity\Traits\TranslatableTrait;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. /**
  11.  * @Vich\Uploadable
  12.  * @ORM\Entity(repositoryClass="App\Repository\PageDefaultRepository")
  13.  * @ORM\Table(name="app_page_default")
  14.  */
  15. class PageDefault
  16. {
  17.     use TranslatableTrait;
  18.     use EntityTrait {
  19.         EntityTrait::__construct as private __entityConstruct;
  20.     }
  21.     use PageTrait {
  22.         PageTrait::__construct as private __pageConstruct;
  23.     }
  24.     /**
  25.      * @ORM\OneToMany(targetEntity="App\Entity\PageText", mappedBy="page_default", cascade={"persist", "remove"},
  26.      *     orphanRemoval=true)
  27.      */
  28.     private $texts;
  29.     /**
  30.      * @ORM\OneToMany(targetEntity="App\Entity\PageImage", mappedBy="page_default", cascade={"persist", "remove"},
  31.      *     orphanRemoval=true)
  32.      */
  33.     private $images;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity="App\Entity\PageSlide", mappedBy="page_default", cascade={"persist", "remove"},
  36.      *     orphanRemoval=true)
  37.      */
  38.     private $slides;
  39.     /**
  40.      * @ORM\OneToMany(targetEntity="App\Entity\PageSlide", mappedBy="page_home", cascade={"persist", "remove"},
  41.      *     orphanRemoval=true)
  42.      */
  43.     private $home_slides;
  44.     /**
  45.      * @ORM\OneToMany(targetEntity="App\Entity\PageItem", mappedBy="page_default", cascade={"persist", "remove"},
  46.      *     orphanRemoval=true)
  47.      */
  48.     private $items;
  49.         /**
  50.      * @ORM\OneToMany(targetEntity="App\Entity\PageItem", mappedBy="page_second", cascade={"persist", "remove"},
  51.      *     orphanRemoval=true)
  52.      */
  53.     private $second_items;
  54.     /**
  55.      * @ORM\OneToMany(targetEntity="App\Entity\PageBreadcrumb", mappedBy="page_default", cascade={"persist", "remove"},
  56.      *      orphanRemoval=true)
  57.      */
  58.     private $breadcrumbs;
  59.     private $collections = [
  60.         'image''slide''text''breadcrumb''item''homeSlide''secondItem'
  61.     ];
  62.     /**
  63.      * Constructeur
  64.      * @throws \Exception
  65.      */
  66.     public function __construct()
  67.     {
  68.         $this->__entityConstruct();
  69.         $this->__pageConstruct();
  70.         $this->images = new ArrayCollection();
  71.         $this->slides = new ArrayCollection();
  72.         $this->texts = new ArrayCollection();
  73.         $this->items = new ArrayCollection();
  74.         $this->breadcrumbs = new ArrayCollection();
  75.         $this->home_slides = new ArrayCollection();
  76.         $this->second_items = new ArrayCollection();
  77.     }
  78.     public function getCollections()
  79.     {
  80.         return $this->collections;
  81.     }
  82.     /**
  83.      * Collection - Breadcrumbs
  84.      */
  85.     public function getBreadcrumbs()
  86.     {
  87.         return $this->breadcrumbs;
  88.     }
  89.     public function setBreadcrumbs($breadcrumbs)
  90.     {
  91.         $this->breadcrumbs $breadcrumbs;
  92.         return $this;
  93.     }
  94.     public function addBreadcrumb($breadcrumb)
  95.     {
  96.         $this->breadcrumbs->add($breadcrumb);
  97.         $breadcrumb->setPageDefault($this);
  98.         return $this;
  99.     }
  100.     public function removeBreadcrumb($breadcrumb)
  101.     {
  102.         $this->breadcrumbs->removeElement($breadcrumb);
  103.         return $this;
  104.     }
  105.     /**
  106.      * Collection - Texts
  107.      */
  108.     public function getTexts()
  109.     {
  110.         return $this->getCollectionSortBySortorder($this->texts);
  111.     }
  112.     public function getTextsArray()
  113.     {
  114.         return $this->getCollectionArraySortBySortorder($this->texts);
  115.     }
  116.     public function setTexts($items)
  117.     {
  118.         $this->texts $items;
  119.         return $this;
  120.     }
  121.     public function addText($item)
  122.     {
  123.         $this->texts->add($item);
  124.         $item->setPageDefault($this);
  125.         return $this;
  126.     }
  127.     public function removeText($item)
  128.     {
  129.         $this->texts->removeElement($item);
  130.         return $this;
  131.     }
  132.     /**
  133.      * Collection - Images
  134.      */
  135.     public function getImages()
  136.     {
  137.         return $this->getCollectionSortBySortorder($this->images);
  138.     }
  139.     public function getImagesArray()
  140.     {
  141.         return $this->getCollectionArraySortBySortorder($this->images);
  142.     }
  143.     public function setImages($items)
  144.     {
  145.         $this->images $items;
  146.         return $this;
  147.     }
  148.     public function addImage($item)
  149.     {
  150.         $this->images->add($item);
  151.         $item->setPageDefault($this);
  152.         return $this;
  153.     }
  154.     public function removeImage($item)
  155.     {
  156.         $this->images->removeElement($item);
  157.         return $this;
  158.     }
  159.     /**
  160.      * Collection - Slides
  161.      */
  162.     public function getSlides()
  163.     {
  164.         return $this->slides;
  165.     }
  166.     public function setSlides($items)
  167.     {
  168.         $this->slides $items;
  169.         return $this;
  170.     }
  171.     public function addSlide($item)
  172.     {
  173.         $this->slides->add($item);
  174.         $item->setPageDefault($this);
  175.         return $this;
  176.     }
  177.     public function removeSlide($item)
  178.     {
  179.         $this->slides->removeElement($item);
  180.         return $this;
  181.     }
  182.     /**
  183.      * Collection - Items
  184.      */
  185.     public function getItems()
  186.     {
  187.         return $this->items;
  188.     }
  189.     public function setItems($items)
  190.     {
  191.         $this->items $items;
  192.         return $this;
  193.     }
  194.     public function addItem($item)
  195.     {
  196.         $this->items->add($item);
  197.         $item->setPageDefault($this);
  198.         return $this;
  199.     }
  200.     public function removeItem($item)
  201.     {
  202.         $this->items->removeElement($item);
  203.         return $this;
  204.     }
  205.     /**
  206.      * Collection - HomeSlides
  207.      */
  208.     public function getHomeSlides()
  209.     {
  210.         return $this->home_slides;
  211.     }
  212.     public function setHomeSlides($items)
  213.     {
  214.         $this->home_slides $items;
  215.         return $this;
  216.     }
  217.     public function addHomeSlide($item)
  218.     {
  219.         $this->home_slides->add($item);
  220.         $item->setPageHome($this);
  221.         return $this;
  222.     }
  223.     public function removeHomeSlide($item)
  224.     {
  225.         $this->home_slides->removeElement($item);
  226.         return $this;
  227.     }
  228.     /**
  229.      * Collection - SecondItems
  230.      */
  231.     public function getSecondItems()
  232.     {
  233.         return $this->second_items;
  234.     }
  235.     public function setSecondItems($items)
  236.     {
  237.         $this->second_items $items;
  238.         return $this;
  239.     }
  240.     public function addSecondItem($item)
  241.     {
  242.         $this->second_items->add($item);
  243.         $item->setPageSecond($this);
  244.         return $this;
  245.     }
  246.     public function removeSecondItem($item)
  247.     {
  248.         $this->second_items->removeElement($item);
  249.         return $this;
  250.     }
  251. }