src/AppBundle/Entity/PageGeneral.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Core\Entity\ControllerList;
  4. use Core\Entity\Traits\EntityTrait;
  5. use Core\Entity\Traits\PageTrait;
  6. use Core\Entity\Traits\TranslatableTrait;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\HttpFoundation\File\File;
  10. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  11. /**
  12.  * @Vich\Uploadable
  13.  * @ORM\Entity(repositoryClass="App\Repository\PageGeneralRepository")
  14.  * @ORM\Table(name="app_page_general")
  15.  */
  16. class PageGeneral
  17. {
  18.     use TranslatableTrait;
  19.     use EntityTrait {
  20.         EntityTrait::__construct as private __entityConstruct;
  21.     }
  22.     use PageTrait {
  23.         PageTrait::__construct as private __pageConstruct;
  24.     }
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $sitename;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      */
  32.     private $domain;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      * @var string
  36.      */
  37.     private $logo;
  38.     /**
  39.      * @Vich\UploadableField(mapping="images", fileNameProperty="logo")
  40.      * @var File
  41.      */
  42.     private $logoFile;
  43.     /**
  44.      * @ORM\Column(type="boolean")
  45.      */
  46.     protected $use_popin;
  47.     /**
  48.      * @ORM\Column(type="boolean")
  49.      */
  50.     protected $use_cookie_popin;
  51.     /**
  52.      * @ORM\Column(type="string", length=255,nullable=true)
  53.      */
  54.     protected $popin_cookie_name;
  55.     /**
  56.      * @ORM\Column(type="boolean")
  57.      */
  58.     protected $use_popin_redirect;
  59.     /**
  60.      * @ORM\Column(type="string", length=255,nullable=true)
  61.      */
  62.     protected $popin_redirect;
  63.     /**
  64.      * @ORM\Column(type="string", length=255, nullable=true)
  65.      * @var string
  66.      */
  67.     private $popin;
  68.     /**
  69.      * @Vich\UploadableField(mapping="images", fileNameProperty="popin")
  70.      * @var File
  71.      */
  72.     private $popinFile;
  73.     /**
  74.      * @ORM\OneToMany(targetEntity="App\Entity\PageSlide", mappedBy="page_general", cascade={"persist", "remove"},
  75.      *     orphanRemoval=true)
  76.      */
  77.     private $slides;
  78.     /**
  79.      * @ORM\OneToMany(targetEntity="App\Entity\PageText", mappedBy="page_general", cascade={"persist", "remove"},
  80.      *     orphanRemoval=true)
  81.      */
  82.     private $texts;
  83.     /**
  84.      * @ORM\OneToMany(targetEntity="App\Entity\PageImage", mappedBy="page_general", cascade={"persist", "remove"},
  85.      *     orphanRemoval=true)
  86.      */
  87.     private $images;
  88.     /**
  89.      * @ORM\OneToMany(targetEntity="App\Entity\PageItem", mappedBy="page_general", cascade={"persist", "remove"},
  90.      *     orphanRemoval=true)
  91.      */
  92.     private $items;
  93.     private $collections = [
  94.         'image''slide''text''item'
  95.     ];
  96.     /**
  97.      * Constructeur
  98.      * @throws \Exception
  99.      */
  100.     public function __construct()
  101.     {
  102.         $this->__entityConstruct();
  103.         $this->__pageConstruct();
  104.         $this->images = new ArrayCollection();
  105.         $this->slides = new ArrayCollection();
  106.         $this->texts = new ArrayCollection();
  107.         $this->items = new ArrayCollection();
  108.     }
  109.     public function getCollections()
  110.     {
  111.         return $this->collections;
  112.     }
  113.     /**
  114.      * Collection - Items
  115.      */
  116.     public function getItems()
  117.     {
  118.         return $this->items;
  119.     }
  120.     public function setItems($items)
  121.     {
  122.         $this->items $items;
  123.         return $this;
  124.     }
  125.     public function addItem($item)
  126.     {
  127.         $this->items->add($item);
  128.         $item->setPageGeneral($this);
  129.         return $this;
  130.     }
  131.     public function removeItem($item)
  132.     {
  133.         $this->items->removeElement($item);
  134.         return $this;
  135.     }
  136.     /**
  137.      * Collection - Texts
  138.      */
  139.     public function getTexts()
  140.     {
  141.         return $this->getCollectionSortBySortorder($this->texts);
  142.     }
  143.     public function getTextsArray()
  144.     {
  145.         return $this->getCollectionArraySortBySortorder($this->texts);
  146.     }
  147.     public function setTexts($items)
  148.     {
  149.         $this->texts $items;
  150.         return $this;
  151.     }
  152.     public function addText($item)
  153.     {
  154.         $this->texts->add($item);
  155.         $item->setPageGeneral($this);
  156.         return $this;
  157.     }
  158.     public function removeText($item)
  159.     {
  160.         $this->texts->removeElement($item);
  161.         return $this;
  162.     }
  163.     /**
  164.      * Collection - Images
  165.      */
  166.     public function getImagesArray()
  167.     {
  168.         return $this->getCollectionArraySortBySortorder($this->images);
  169.     }
  170.     public function getImages()
  171.     {
  172.         return $this->images;
  173.     }
  174.     public function setImages($items)
  175.     {
  176.         $this->images $items;
  177.         return $this;
  178.     }
  179.     public function addImage($item)
  180.     {
  181.         $this->images->add($item);
  182.         $item->setPageGeneral($this);
  183.         return $this;
  184.     }
  185.     public function removeImage($item)
  186.     {
  187.         $this->images->removeElement($item);
  188.         return $this;
  189.     }
  190.     /**
  191.      * Collection - Slides
  192.      */
  193.     public function getSlides()
  194.     {
  195.         return $this->slides;
  196.     }
  197.     public function setSlides($items)
  198.     {
  199.         $this->slides $items;
  200.         return $this;
  201.     }
  202.     public function addSlide($item)
  203.     {
  204.         $this->slides->add($item);
  205.         $item->setPageGeneral($this);
  206.         return $this;
  207.     }
  208.     public function removeSlide($item)
  209.     {
  210.         $this->slides->removeElement($item);
  211.         return $this;
  212.     }
  213.     /**
  214.      * @return mixed
  215.      */
  216.     public function getSitename()
  217.     {
  218.         return $this->sitename;
  219.     }
  220.     /**
  221.      * @param mixed $sitename
  222.      */
  223.     public function setSitename($sitename): void
  224.     {
  225.         $this->sitename $sitename;
  226.     }
  227.     public function getDomain()
  228.     {
  229.         return $this->domain;
  230.     }
  231.     public function setDomain($domain)
  232.     {
  233.         $this->domain $domain;
  234.     }
  235.     public function getLogo()
  236.     {
  237.         return $this->logo;
  238.     }
  239.     public function setLogo($logo)
  240.     {
  241.         $this->logo $logo;
  242.     }
  243.     public function getLogoFile()
  244.     {
  245.         return $this->logoFile;
  246.     }
  247.     public function setLogoFile($logoFile)
  248.     {
  249.         $this->logoFile $logoFile;
  250.         if ($logoFile) {
  251.             $this->setUpdatedAt(new \DateTime('now'));
  252.         }
  253.     }
  254.     public function getUsePopin()
  255.     {
  256.         return $this->use_popin;
  257.     }
  258.     public function setUsePopin($use_popin)
  259.     {
  260.         $this->use_popin $use_popin;
  261.     }
  262.     public function getPopin()
  263.     {
  264.         return $this->popin;
  265.     }
  266.     public function setPopin($popin)
  267.     {
  268.         $this->popin $popin;
  269.     }
  270.     public function getPopinFile()
  271.     {
  272.         return $this->popinFile;
  273.     }
  274.     public function setPopinFile($popinFile)
  275.     {
  276.         $this->popinFile $popinFile;
  277.         if ($popinFile) {
  278.             $this->setUpdatedAt(new \DateTime('now'));
  279.         }
  280.     }
  281.     public function getUseCookiePopin()
  282.     {
  283.         return $this->use_cookie_popin;
  284.     }
  285.     public function setUseCookiePopin($use_cookie_popin)
  286.     {
  287.         $this->use_cookie_popin $use_cookie_popin;
  288.     }
  289.     public function getPopinCookieName()
  290.     {
  291.         return $this->popin_cookie_name;
  292.     }
  293.     public function setPopinCookieName($popin_cookie_name)
  294.     {
  295.         $this->popin_cookie_name $popin_cookie_name;
  296.     }
  297.     public function getPopinRedirect()
  298.     {
  299.         return $this->popin_redirect;
  300.     }
  301.     public function setPopinRedirect($popin_redirect)
  302.     {
  303.         $this->popin_redirect $popin_redirect;
  304.     }
  305.     public function getUsePopinRedirect()
  306.     {
  307.         return $this->use_popin_redirect;
  308.     }
  309.     public function setUsePopinRedirect($use_popin_redirect)
  310.     {
  311.         $this->use_popin_redirect $use_popin_redirect;
  312.     }
  313. }