Advertisement
Guest User

Untitled

a guest
Jul 16th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 5.32 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Enp\Bundle\ProductOfferBundle\Entity;
  4.  
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Enp\Bundle\WebsiteBundle\Entity\Website;
  8.  
  9. /**
  10.  * @author Grzegorz Różycki  <grzegorz.rozycki@enp.pl>
  11.  * @author Łukasz Rajczyk <lukasz.rajczyk@enp.pl>
  12.  * @author Bartosz Wrona <bartosz.wrona@enp.pl>
  13.  * @author Daniel Gołąbek <daniel.golabek@enp.pl>
  14.  */
  15. class ViewStrategy
  16. {
  17.     /**
  18.      * @var integer
  19.      */
  20.     private $id;
  21.  
  22.     /**
  23.      * @var boolean
  24.      */
  25.     private $global = true;
  26.  
  27.     /**
  28.      * @var boolean
  29.      */
  30.     private $default = false;
  31.    
  32.     /**
  33.      * @var boolean
  34.      */
  35.     private $useGlobalLimiters = false;
  36.  
  37.     /**
  38.      * @var integer
  39.      */
  40.     private $order = 0;
  41.  
  42.     /**
  43.      * @var string
  44.      */
  45.     private $service = '';
  46.  
  47.     /**
  48.      * @var array
  49.      */
  50.     private $config = [];
  51.  
  52.     /**
  53.      * @var Collection
  54.      */
  55.     private $websites = [];
  56.  
  57.     /**
  58.      * @var Collection
  59.      */
  60.     private $viewLimiters = [] ;
  61.  
  62.     /**
  63.      * @var bool
  64.      */
  65.     private $es = false;
  66.  
  67.     /**
  68.      * @var bool
  69.      */
  70.     private $uniqueParamStrategy = false;
  71.  
  72.     /**
  73.      * Constructor
  74.      */
  75.     public function __construct()
  76.     {
  77.         $this->viewLimiters = new ArrayCollection();
  78.         $this->websites = new ArrayCollection();
  79.     }
  80.  
  81.     /**
  82.      * @return int
  83.      */
  84.     public function getId(): int
  85.     {
  86.         return $this->id;
  87.     }
  88.  
  89.     /**
  90.      * @param int $id
  91.      */
  92.     public function setId(int $id): void
  93.     {
  94.         $this->id = $id;
  95.     }
  96.  
  97.     /**
  98.      * @return bool
  99.      */
  100.     public function isGlobal(): bool
  101.     {
  102.         return $this->global;
  103.     }
  104.  
  105.     /**
  106.      * @param bool $global
  107.      */
  108.     public function setGlobal(bool $global): void
  109.     {
  110.         $this->global = $global;
  111.     }
  112.  
  113.     /**
  114.      * @return bool
  115.      */
  116.     public function isDefault(): bool
  117.     {
  118.         return $this->default;
  119.     }
  120.  
  121.     /**
  122.      * @param bool $default
  123.      */
  124.     public function setDefault(bool $default): void
  125.     {
  126.         $this->default = $default;
  127.     }
  128.  
  129.     /**
  130.      * @return bool
  131.      */
  132.     public function isUseGlobalLimiters(): bool
  133.     {
  134.         return $this->useGlobalLimiters;
  135.     }
  136.  
  137.     /**
  138.      * @param bool $useGlobalLimiters
  139.      */
  140.     public function setUseGlobalLimiters(bool $useGlobalLimiters): void
  141.     {
  142.         $this->useGlobalLimiters = $useGlobalLimiters;
  143.     }
  144.  
  145.     /**
  146.      * @return int
  147.      */
  148.     public function getOrder(): int
  149.     {
  150.         return $this->order;
  151.     }
  152.  
  153.     /**
  154.      * @param int $order
  155.      */
  156.     public function setOrder(int $order): void
  157.     {
  158.         $this->order = $order;
  159.     }
  160.  
  161.     /**
  162.      * @return string
  163.      */
  164.     public function getService(): string
  165.     {
  166.         return $this->service;
  167.     }
  168.  
  169.     /**
  170.      * @param string $service
  171.      */
  172.     public function setService(string $service): void
  173.     {
  174.         $this->service = $service;
  175.     }
  176.  
  177.     /**
  178.      * @return array
  179.      */
  180.     public function getConfig(): array
  181.     {
  182.         return $this->config;
  183.     }
  184.  
  185.     /**
  186.      * @param array $config
  187.      */
  188.     public function setConfig(array $config): void
  189.     {
  190.         $this->config = $config;
  191.     }
  192.  
  193.     /**
  194.      * @return Collection|Website[]
  195.      */
  196.     public function getWebsites(): ?Collection
  197.     {
  198.         return $this->websites;
  199.     }
  200.  
  201.     /**
  202.      * @param Website $website
  203.      * @return ViewStrategy
  204.      */
  205.     public function addWebsites(Website $website): self
  206.     {
  207.         if (!$this->websites->contains($website)) {
  208.             $this->websites[] = $website;
  209.         }
  210.         return $this;
  211.     }
  212.  
  213.     /**
  214.      * @param Website $website
  215.      * @return ViewStrategy
  216.      */
  217.     public function removeWebsites(Website $website): self
  218.     {
  219.         if (!$this->websites->contains($website)) {
  220.             $this->websites->removeElement($website);
  221.         }
  222.         return $this;
  223.     }
  224.  
  225.     /**
  226.      * @return Collection
  227.      */
  228.     public function getViewLimiters(): Collection
  229.     {
  230.         return $this->viewLimiters;
  231.     }
  232.  
  233.  
  234.     /**
  235.      * @param ViewLimiter $viewLimiter
  236.      * @return ViewStrategy
  237.      */
  238.     public function addViewLimiter(ViewLimiter $viewLimiter): self
  239.     {
  240.         $this->viewLimiters->add($viewLimiter);
  241.         return $this;
  242.     }
  243.  
  244.     /**
  245.      * @param ViewLimiter $viewLimiter
  246.      * @return ViewStrategy
  247.      */
  248.     public function removeViewLimiter(ViewLimiter $viewLimiter): self
  249.     {
  250.         if (!$this->viewLimiters->contains($viewLimiter)) {
  251.             $this->viewLimiters->removeElement($viewLimiter);
  252.         }
  253.         return $this;
  254.     }
  255.  
  256.     /**
  257.      * @return bool
  258.      */
  259.     public function isEs(): bool
  260.     {
  261.         return $this->es;
  262.     }
  263.  
  264.     /**
  265.      * @param bool $es
  266.      */
  267.     public function setEs(bool $es): void
  268.     {
  269.         $this->es = $es;
  270.     }
  271.  
  272.     /**
  273.      * @return bool
  274.      */
  275.     public function isUniqueParamStrategy(): bool
  276.     {
  277.         return $this->uniqueParamStrategy;
  278.     }
  279.  
  280.     /**
  281.      * @param bool $uniqueParamStrategy
  282.      */
  283.     public function setUniqueParamStrategy(bool $uniqueParamStrategy): void
  284.     {
  285.         $this->uniqueParamStrategy = $uniqueParamStrategy;
  286.     }
  287. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement