Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace Enp\Bundle\ProductOfferBundle\Entity;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\Common\Collections\Collection;
- use Enp\Bundle\WebsiteBundle\Entity\Website;
- /**
- * @author Grzegorz Różycki <grzegorz.rozycki@enp.pl>
- * @author Łukasz Rajczyk <lukasz.rajczyk@enp.pl>
- * @author Bartosz Wrona <bartosz.wrona@enp.pl>
- * @author Daniel Gołąbek <daniel.golabek@enp.pl>
- */
- class ViewStrategy
- {
- /**
- * @var integer
- */
- private $id;
- /**
- * @var boolean
- */
- private $global = true;
- /**
- * @var boolean
- */
- private $default = false;
- /**
- * @var boolean
- */
- private $useGlobalLimiters = false;
- /**
- * @var integer
- */
- private $order = 0;
- /**
- * @var string
- */
- private $service = '';
- /**
- * @var array
- */
- private $config = [];
- /**
- * @var Collection
- */
- private $websites = [];
- /**
- * @var Collection
- */
- private $viewLimiters = [] ;
- /**
- * @var bool
- */
- private $es = false;
- /**
- * @var bool
- */
- private $uniqueParamStrategy = false;
- /**
- * Constructor
- */
- public function __construct()
- {
- $this->viewLimiters = new ArrayCollection();
- $this->websites = new ArrayCollection();
- }
- /**
- * @return int
- */
- public function getId(): int
- {
- return $this->id;
- }
- /**
- * @param int $id
- */
- public function setId(int $id): void
- {
- $this->id = $id;
- }
- /**
- * @return bool
- */
- public function isGlobal(): bool
- {
- return $this->global;
- }
- /**
- * @param bool $global
- */
- public function setGlobal(bool $global): void
- {
- $this->global = $global;
- }
- /**
- * @return bool
- */
- public function isDefault(): bool
- {
- return $this->default;
- }
- /**
- * @param bool $default
- */
- public function setDefault(bool $default): void
- {
- $this->default = $default;
- }
- /**
- * @return bool
- */
- public function isUseGlobalLimiters(): bool
- {
- return $this->useGlobalLimiters;
- }
- /**
- * @param bool $useGlobalLimiters
- */
- public function setUseGlobalLimiters(bool $useGlobalLimiters): void
- {
- $this->useGlobalLimiters = $useGlobalLimiters;
- }
- /**
- * @return int
- */
- public function getOrder(): int
- {
- return $this->order;
- }
- /**
- * @param int $order
- */
- public function setOrder(int $order): void
- {
- $this->order = $order;
- }
- /**
- * @return string
- */
- public function getService(): string
- {
- return $this->service;
- }
- /**
- * @param string $service
- */
- public function setService(string $service): void
- {
- $this->service = $service;
- }
- /**
- * @return array
- */
- public function getConfig(): array
- {
- return $this->config;
- }
- /**
- * @param array $config
- */
- public function setConfig(array $config): void
- {
- $this->config = $config;
- }
- /**
- * @return Collection|Website[]
- */
- public function getWebsites(): ?Collection
- {
- return $this->websites;
- }
- /**
- * @param Website $website
- * @return ViewStrategy
- */
- public function addWebsites(Website $website): self
- {
- if (!$this->websites->contains($website)) {
- $this->websites[] = $website;
- }
- return $this;
- }
- /**
- * @param Website $website
- * @return ViewStrategy
- */
- public function removeWebsites(Website $website): self
- {
- if (!$this->websites->contains($website)) {
- $this->websites->removeElement($website);
- }
- return $this;
- }
- /**
- * @return Collection
- */
- public function getViewLimiters(): Collection
- {
- return $this->viewLimiters;
- }
- /**
- * @param ViewLimiter $viewLimiter
- * @return ViewStrategy
- */
- public function addViewLimiter(ViewLimiter $viewLimiter): self
- {
- $this->viewLimiters->add($viewLimiter);
- return $this;
- }
- /**
- * @param ViewLimiter $viewLimiter
- * @return ViewStrategy
- */
- public function removeViewLimiter(ViewLimiter $viewLimiter): self
- {
- if (!$this->viewLimiters->contains($viewLimiter)) {
- $this->viewLimiters->removeElement($viewLimiter);
- }
- return $this;
- }
- /**
- * @return bool
- */
- public function isEs(): bool
- {
- return $this->es;
- }
- /**
- * @param bool $es
- */
- public function setEs(bool $es): void
- {
- $this->es = $es;
- }
- /**
- * @return bool
- */
- public function isUniqueParamStrategy(): bool
- {
- return $this->uniqueParamStrategy;
- }
- /**
- * @param bool $uniqueParamStrategy
- */
- public function setUniqueParamStrategy(bool $uniqueParamStrategy): void
- {
- $this->uniqueParamStrategy = $uniqueParamStrategy;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement