<?php
namespace App\Entity;
use App\Repository\CatalogueRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CatalogueRepository::class)
*/
class Catalogue
{
public const CATALOGUE_TYPE_OBJPUB = 'obj_pub';
public const CATALOGUE_TYPE_SHOPPING = 'shopping';
public const CATALOGUE_TYPE_CUSTOMER = 'customer';
public const CATALOGUE_TYPE_EVASION = 'evasion';
public const CATALOGUE_TYPE_GIFT_CERTIFICATE = 'gift_certificate';
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $slug;
/**
* @ORM\ManyToOne(targetEntity=Setting::class, inversedBy="catalogues")
* @ORM\JoinColumn(nullable=false)
*/
private $settingCatalogue;
/**
* @ORM\Column(type="string", length=255)
*/
private $label;
/**
* @ORM\Column(type="boolean")
*/
private $enabled;
/**
* @ORM\Column(type="boolean")
*/
private $standAlone;
/**
* @ORM\Column(type="text")
*/
private $types;
/**
* @ORM\Column(type="text")
*/
private $campaigns;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $alertStock;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $include;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $filters;
/**
* @ORM\Column(type="boolean")
*/
private $enabledResetFilters;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $fees;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $sorts;
/**
* @ORM\OneToMany(targetEntity=Slider::class, mappedBy="catalog")
* @ORM\JoinColumn(nullable=true)
*/
private $sliders;
/**
* @ORM\Column(type="boolean")
*/
private $canOrder;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $hideFilters;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $specificExclusion;
/**
* @ORM\Column(type="boolean")
*/
private bool $displayIfNoStock = false;
/**
* @ORM\Column(type="boolean")
*/
private bool $displayIfPriceZero = false;
/**
* @ORM\Column(type="boolean")
*/
private bool $isFilteredByParentBOCategory = true;
/**
* @ORM\Column(type="integer", options={"default": 99})
*/
private $orderItem;
public function __construct()
{
$this->sliders = new ArrayCollection();
}
public function __toString(): string
{
return $this->getSlug();
}
public function getId(): ?int
{
return $this->id;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug( ?string $slug ): self
{
$this->slug = $slug;
return $this;
}
public function getSettingCatalogue(): ?Setting
{
return $this->settingCatalogue;
}
public function setSettingCatalogue( ?Setting $settingCatalogue ): self
{
$this->settingCatalogue = $settingCatalogue;
return $this;
}
/**
* @return mixed
*/
public function getLabel()
{
return $this->label;
}
/**
* @param mixed $label
* @return Catalogue
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* @return mixed
*/
public function getEnabled()
{
return $this->enabled;
}
/**
* @param mixed $enabled
* @return Catalogue
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
return $this;
}
/**
* @return mixed
*/
public function getStandAlone()
{
return $this->standAlone;
}
/**
* @param mixed $standAlone
* @return Catalogue
*/
public function setStandAlone($standAlone)
{
$this->standAlone = $standAlone;
return $this;
}
/**
* @return mixed
*/
public function getTypes()
{
return $this->types;
}
/**
* @param mixed $types
* @return Catalogue
*/
public function setTypes($types)
{
$this->types = $types;
return $this;
}
/**
* @return mixed
*/
public function getCampaigns()
{
return $this->campaigns;
}
/**
* @param mixed $campaigns
*
* @return Catalogue
*/
public function setCampaigns($campaigns)
{
$this->campaigns = $campaigns;
return $this;
}
/**
* @return mixed
*/
public function getAlertStock()
{
return $this->alertStock;
}
/**
* @param mixed $alertStock
* @return Catalogue
*/
public function setAlertStock($alertStock)
{
$this->alertStock = $alertStock;
return $this;
}
/**
* @return mixed
*/
public function getInclude()
{
return $this->include;
}
/**
* @param $include
* @return $this
*/
public function setInclude($include)
{
$this->include = $include;
return $this;
}
/**
* @return mixed
*/
public function getFilters()
{
return $this->filters;
}
/**
* @param $filters
* @return $this
*/
public function setFilters($filters)
{
$this->filters = $filters;
return $this;
}
/**
* @return mixed
*/
public function getSorts()
{
return $this->sorts;
}
/**
* @param $sorts
* @return $this
*/
public function setSorts($sorts)
{
$this->sorts = $sorts;
return $this;
}
/**
* @return mixed
*/
public function getEnabledResetFilters()
{
return $this->enabledResetFilters;
}
/**
* @param mixed $enabledResetFilters
* @return Catalogue
*/
public function setEnabledResetFilters($enabledResetFilters)
{
$this->enabledResetFilters = $enabledResetFilters;
return $this;
}
/**
* @return mixed
*/
public function getFees()
{
return $this->fees;
}
/**
* @param mixed $fees
*
* @return $this
*/
public function setFees($fees): self
{
$this->fees = $fees;
return $this;
}
/**
* @return Collection<int, Slider>
*/
public function getSliders(): Collection
{
return $this->sliders;
}
public function addSlider(Slider $slider): self
{
if (!$this->sliders->contains($slider)) {
$this->sliders[] = $slider;
$slider->setCatalog($this);
}
return $this;
}
public function removeSlider(Slider $slider): self
{
if ($this->sliders->removeElement($slider)) {
// set the owning side to null (unless already changed)
if ($slider->getCatalog() === $this) {
$slider->setCatalog(null);
}
}
return $this;
}
/**
* @return mixed
*/
public function getCanOrder()
{
return $this->canOrder;
}
/**
* @param mixed $canOrder
* @return Catalogue
*/
public function setCanOrder($canOrder): Catalogue
{
$this->canOrder = $canOrder;
return $this;
}
/**
* @return bool
*/
public function getDisplayIfNoStock(): bool
{
return $this->displayIfNoStock;
}
/**
* @param bool $displayIfNoStock
*
* @return Catalogue
*/
public function setDisplayIfNoStock(bool $displayIfNoStock): Catalogue
{
$this->displayIfNoStock = $displayIfNoStock;
return $this;
}
/**
* @return bool
*/
public function getDisplayIfPriceZero(): bool
{
return $this->displayIfPriceZero;
}
/**
* @param bool $displayIfPriceZero
*
* @return Catalogue
*/
public function setDisplayIfPriceZero(bool $displayIfPriceZero): Catalogue
{
$this->displayIfPriceZero = $displayIfPriceZero;
return $this;
}
/**
* @return bool
*/
public function getIsFilteredByParentBOCategory(): bool
{
return $this->isFilteredByParentBOCategory;
}
/**
* @param bool $isFilteredByParentBOCategory
*
* @return Catalogue
*/
public function setIsFilteredByParentBOCategory(bool $isFilteredByParentBOCategory): Catalogue
{
$this->isFilteredByParentBOCategory = $isFilteredByParentBOCategory;
return $this;
}
/**
* @return mixed
*/
public function getHideFilters()
{
return $this->hideFilters;
}
/**
* @param $hideFilters
* @return $this
*/
public function setHideFilters($hideFilters)
{
$this->hideFilters = $hideFilters;
return $this;
}
/**
* @return string|null
*/
public function getSpecificExclusion(): ?string
{
return $this->specificExclusion;
}
/**
* @param $specificExclusion
* @return $this
*/
public function setSpecificExclusion($specificExclusion)
{
$this->specificExclusion = $specificExclusion;
return $this;
}
public function getOrderItem(): ?int
{
return $this->orderItem;
}
public function setOrderItem( int $orderItem ): self
{
$this->orderItem = $orderItem;
return $this;
}
}