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"}, orphanRemoval=true)
  75.      */
  76.     private $slides;
  77.     /**
  78.      * @ORM\OneToMany(targetEntity="App\Entity\PageText", mappedBy="page_general", cascade={"persist", "remove"}, orphanRemoval=true)
  79.      */
  80.     private $texts;
  81.     /**
  82.      * @ORM\OneToMany(targetEntity="App\Entity\PageImage", mappedBy="page_general", cascade={"persist", "remove"}, orphanRemoval=true)
  83.      */
  84.     private $images;
  85.     /**
  86.      * @ORM\OneToMany(targetEntity="App\Entity\PageItem", mappedBy="page_general", cascade={"persist", "remove"}, orphanRemoval=true)
  87.      */
  88.     private $items;
  89.     /**
  90.      * @ORM\OneToMany(targetEntity="App\Entity\PageItem", mappedBy="page_general_carousel", cascade={"persist", "remove"}, orphanRemoval=true)
  91.      */
  92.     private $carousels;
  93.     /**
  94.      * @ORM\OneToMany(targetEntity="App\Entity\PageItem", mappedBy="page_general_message", cascade={"persist", "remove"}, orphanRemoval=true)
  95.      */
  96.     private $messages;
  97.     private $collections = [
  98.         'image''slide''text''item''message''carousel'
  99.     ];
  100.     /**
  101.      * Constructeur
  102.      * @throws \Exception
  103.      */
  104.     public function __construct()
  105.     {
  106.         $this->__entityConstruct();
  107.         $this->__pageConstruct();
  108.         $this->images = new ArrayCollection();
  109.         $this->slides = new ArrayCollection();
  110.         $this->texts = new ArrayCollection();
  111.         $this->items = new ArrayCollection();
  112.         $this->messages = new ArrayCollection();
  113.         $this->carousels = new ArrayCollection();
  114.     }
  115.     public function getCollections()
  116.     {
  117.         return $this->collections;
  118.     }
  119.     /**
  120.      * Collection - Items
  121.      */
  122.     public function getItems()
  123.     {
  124.         return $this->items;
  125.     }
  126.     public function setItems($items)
  127.     {
  128.         $this->items $items;
  129.         return $this;
  130.     }
  131.     public function addItem($item)
  132.     {
  133.         $this->items->add($item);
  134.         $item->setPageGeneral($this);
  135.         return $this;
  136.     }
  137.     public function removeItem($item)
  138.     {
  139.         $this->items->removeElement($item);
  140.         return $this;
  141.     }
  142.     /**
  143.      * Collection - Messages
  144.      */
  145.     public function getMessages()
  146.     {
  147.         return $this->messages;
  148.     }
  149.     public function setMessages($messages)
  150.     {
  151.         $this->messages $messages;
  152.         return $this;
  153.     }
  154.     public function addMessage($message)
  155.     {
  156.         $this->messages->add($message);
  157.         $message->setPageGeneralMessage($this);
  158.         return $this;
  159.     }
  160.     public function removeMessage($message)
  161.     {
  162.         $this->messages->removeElement($message);
  163.         return $this;
  164.     }
  165.     /**
  166.      * Collection - Texts
  167.      */
  168.     public function getTexts()
  169.     {
  170.         return $this->getCollectionSortBySortorder($this->texts);
  171.     }
  172.     public function getTextsArray()
  173.     {
  174.         return $this->getCollectionArraySortBySortorder($this->texts);
  175.     }
  176.     public function setTexts($items)
  177.     {
  178.         $this->texts $items;
  179.         return $this;
  180.     }
  181.     public function addText($item)
  182.     {
  183.         $this->texts->add($item);
  184.         $item->setPageGeneral($this);
  185.         return $this;
  186.     }
  187.     public function removeText($item)
  188.     {
  189.         $this->texts->removeElement($item);
  190.         return $this;
  191.     }
  192.     /**
  193.      * Collection - Images
  194.      */
  195.     public function getImages()
  196.     {
  197.         return $this->getCollectionSortBySortorder($this->images);
  198.     }
  199.     public function getImagesArray()
  200.     {
  201.         return $this->getCollectionArraySortBySortorder($this->images);
  202.     }
  203.     public function setImages($items)
  204.     {
  205.         $this->images $items;
  206.         return $this;
  207.     }
  208.     public function addImage($item)
  209.     {
  210.         $this->images->add($item);
  211.         $item->setPageGeneral($this);
  212.         return $this;
  213.     }
  214.     public function removeImage($item)
  215.     {
  216.         $this->images->removeElement($item);
  217.         return $this;
  218.     }
  219.     /**
  220.      * Collection - Slides
  221.      */
  222.     public function getSlides()
  223.     {
  224.         return $this->slides;
  225.     }
  226.     public function setSlides($items)
  227.     {
  228.         $this->slides $items;
  229.         return $this;
  230.     }
  231.     public function addSlide($item)
  232.     {
  233.         $this->slides->add($item);
  234.         $item->setPageGeneral($this);
  235.         return $this;
  236.     }
  237.     public function removeSlide($item)
  238.     {
  239.         $this->slides->removeElement($item);
  240.         return $this;
  241.     }
  242.     /**
  243.      * @return mixed
  244.      */
  245.     public function getSitename()
  246.     {
  247.         return $this->sitename;
  248.     }
  249.     /**
  250.      * @param mixed $sitename
  251.      */
  252.     public function setSitename($sitename): void
  253.     {
  254.         $this->sitename $sitename;
  255.     }
  256.     public function getDomain()
  257.     {
  258.         return $this->domain;
  259.     }
  260.     public function setDomain($domain)
  261.     {
  262.         $this->domain $domain;
  263.     }
  264.     public function getLogo()
  265.     {
  266.         return $this->logo;
  267.     }
  268.     public function setLogo($logo)
  269.     {
  270.         $this->logo $logo;
  271.     }
  272.     public function getLogoFile()
  273.     {
  274.         return $this->logoFile;
  275.     }
  276.     public function setLogoFile$logoFile)
  277.     {
  278.         $this->logoFile $logoFile;
  279.         if ($logoFile) {
  280.             $this->setUpdatedAt(new \DateTime('now'));
  281.         }
  282.     }
  283.     public function getUsePopin()
  284.     {
  285.         return $this->use_popin;
  286.     }
  287.     public function setUsePopin($use_popin)
  288.     {
  289.         $this->use_popin $use_popin;
  290.     }
  291.     public function getPopin()
  292.     {
  293.         return $this->popin;
  294.     }
  295.     public function setPopin($popin)
  296.     {
  297.         $this->popin $popin;
  298.     }
  299.     public function getPopinFile()
  300.     {
  301.         return $this->popinFile;
  302.     }
  303.     public function setPopinFile($popinFile)
  304.     {
  305.         $this->popinFile $popinFile;
  306.         if ($popinFile) {
  307.             $this->setUpdatedAt(new \DateTime('now'));
  308.         }
  309.     }
  310.     public function getUseCookiePopin()
  311.     {
  312.         return $this->use_cookie_popin;
  313.     }
  314.     public function setUseCookiePopin($use_cookie_popin)
  315.     {
  316.         $this->use_cookie_popin $use_cookie_popin;
  317.     }
  318.     public function getPopinCookieName()
  319.     {
  320.         return $this->popin_cookie_name;
  321.     }
  322.     public function setPopinCookieName($popin_cookie_name)
  323.     {
  324.         $this->popin_cookie_name $popin_cookie_name;
  325.     }
  326.     public function getPopinRedirect()
  327.     {
  328.         return $this->popin_redirect;
  329.     }
  330.     public function setPopinRedirect($popin_redirect)
  331.     {
  332.         $this->popin_redirect $popin_redirect;
  333.     }
  334.     public function getUsePopinRedirect()
  335.     {
  336.         return $this->use_popin_redirect;
  337.     }
  338.     public function setUsePopinRedirect($use_popin_redirect)
  339.     {
  340.         $this->use_popin_redirect $use_popin_redirect;
  341.     }
  342.     /**
  343.      * Collection - Carousels
  344.      */
  345.     public function getCarousels()
  346.     {
  347.         return $this->carousels;
  348.     }
  349.     public function setCarousels($carousels)
  350.     {
  351.         $this->carousels $carousels;
  352.         return $this;
  353.     }
  354.     public function addCarousel($carousel)
  355.     {
  356.         $this->carousels->add($carousel);
  357.         $carousel->setPageGeneralCarousel($this);
  358.         return $this;
  359.     }
  360.     public function removeCarousel($carousel)
  361.     {
  362.         $this->carousels->removeElement($carousel);
  363.         return $this;
  364.     }
  365. }