<?php
namespace App\Entity;
use Core\Entity\Traits\EntityTrait;
use Core\Entity\Traits\PageTrait;
use Core\Entity\Traits\TranslatableTrait;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @Vich\Uploadable
* @ORM\Entity(repositoryClass="App\Repository\PageDefaultRepository")
* @ORM\Table(name="app_page_default")
*/
class PageDefault
{
use TranslatableTrait;
use EntityTrait {
EntityTrait::__construct as private __entityConstruct;
}
use PageTrait {
PageTrait::__construct as private __pageConstruct;
}
/**
* @ORM\OneToMany(targetEntity="App\Entity\PageText", mappedBy="page_default", cascade={"persist", "remove"},
* orphanRemoval=true)
*/
private $texts;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PageImage", mappedBy="page_default", cascade={"persist", "remove"},
* orphanRemoval=true)
*/
private $images;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PageSlide", mappedBy="page_default", cascade={"persist", "remove"},
* orphanRemoval=true)
*/
private $slides;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PageSlide", mappedBy="page_home", cascade={"persist", "remove"},
* orphanRemoval=true)
*/
private $home_slides;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PageItem", mappedBy="page_default", cascade={"persist", "remove"},
* orphanRemoval=true)
*/
private $items;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PageItem", mappedBy="page_second", cascade={"persist", "remove"},
* orphanRemoval=true)
*/
private $second_items;
/**
* @ORM\OneToMany(targetEntity="App\Entity\PageBreadcrumb", mappedBy="page_default", cascade={"persist", "remove"},
* orphanRemoval=true)
*/
private $breadcrumbs;
private $collections = [
'image', 'slide', 'text', 'breadcrumb', 'item', 'homeSlide', 'secondItem'
];
/**
* Constructeur
* @throws \Exception
*/
public function __construct()
{
$this->__entityConstruct();
$this->__pageConstruct();
$this->images = new ArrayCollection();
$this->slides = new ArrayCollection();
$this->texts = new ArrayCollection();
$this->items = new ArrayCollection();
$this->breadcrumbs = new ArrayCollection();
$this->home_slides = new ArrayCollection();
$this->second_items = new ArrayCollection();
}
public function getCollections()
{
return $this->collections;
}
/**
* Collection - Breadcrumbs
*/
public function getBreadcrumbs()
{
return $this->breadcrumbs;
}
public function setBreadcrumbs($breadcrumbs)
{
$this->breadcrumbs = $breadcrumbs;
return $this;
}
public function addBreadcrumb($breadcrumb)
{
$this->breadcrumbs->add($breadcrumb);
$breadcrumb->setPageDefault($this);
return $this;
}
public function removeBreadcrumb($breadcrumb)
{
$this->breadcrumbs->removeElement($breadcrumb);
return $this;
}
/**
* Collection - Texts
*/
public function getTexts()
{
return $this->getCollectionSortBySortorder($this->texts);
}
public function getTextsArray()
{
return $this->getCollectionArraySortBySortorder($this->texts);
}
public function setTexts($items)
{
$this->texts = $items;
return $this;
}
public function addText($item)
{
$this->texts->add($item);
$item->setPageDefault($this);
return $this;
}
public function removeText($item)
{
$this->texts->removeElement($item);
return $this;
}
/**
* Collection - Images
*/
public function getImages()
{
return $this->getCollectionSortBySortorder($this->images);
}
public function getImagesArray()
{
return $this->getCollectionArraySortBySortorder($this->images);
}
public function setImages($items)
{
$this->images = $items;
return $this;
}
public function addImage($item)
{
$this->images->add($item);
$item->setPageDefault($this);
return $this;
}
public function removeImage($item)
{
$this->images->removeElement($item);
return $this;
}
/**
* Collection - Slides
*/
public function getSlides()
{
return $this->slides;
}
public function setSlides($items)
{
$this->slides = $items;
return $this;
}
public function addSlide($item)
{
$this->slides->add($item);
$item->setPageDefault($this);
return $this;
}
public function removeSlide($item)
{
$this->slides->removeElement($item);
return $this;
}
/**
* Collection - Items
*/
public function getItems()
{
return $this->items;
}
public function setItems($items)
{
$this->items = $items;
return $this;
}
public function addItem($item)
{
$this->items->add($item);
$item->setPageDefault($this);
return $this;
}
public function removeItem($item)
{
$this->items->removeElement($item);
return $this;
}
/**
* Collection - HomeSlides
*/
public function getHomeSlides()
{
return $this->home_slides;
}
public function setHomeSlides($items)
{
$this->home_slides = $items;
return $this;
}
public function addHomeSlide($item)
{
$this->home_slides->add($item);
$item->setPageHome($this);
return $this;
}
public function removeHomeSlide($item)
{
$this->home_slides->removeElement($item);
return $this;
}
/**
* Collection - SecondItems
*/
public function getSecondItems()
{
return $this->second_items;
}
public function setSecondItems($items)
{
$this->second_items = $items;
return $this;
}
public function addSecondItem($item)
{
$this->second_items->add($item);
$item->setPageSecond($this);
return $this;
}
public function removeSecondItem($item)
{
$this->second_items->removeElement($item);
return $this;
}
}