<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Serializer\Annotation\MaxDepth;
// TODO : rendre toutes les props nullables
/**
* @ORM\Table(
* uniqueConstraints={@ORM\UniqueConstraint(name="weblist_unique_slug_per_site", columns={"slug", "site_id" })},
* )
* @ORM\Entity(repositoryClass="App\Repository\WebListRepository")
*/
class WebList
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Selection", inversedBy="webLists")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="selection_id", referencedColumnName="id")
* })
*/
private $selection;
/**
* @ORM\Column(type="string", nullable=true, length=1024, options={"comment":"URL en francais"})
*/
private $permalinkUrl = '';
/**
* @ORM\Column(type="json", nullable=true, options={"comment":"URL en langues"})
*/
private $permalinkUrlTranslation;
/**
* @ORM\Column(type="string", nullable=true, length=1024, options={"comment":"Slug en francais"})
*/
private $slug = '';
/**
* @ORM\Column(type="json", nullable=true, options={"comment":"Slug en langues"})
*/
private $slugTranslation;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $permalinkIsCanonical ;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $doNotCreateRewriteRuleForList ;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebList", inversedBy="originWebLists")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="destination_web_list_id", referencedColumnName="id")
* })
*/
private $destinationWebList;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebList", mappedBy="destinationWebList", cascade={"persist"})
*/
private $originWebLists;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebPage", inversedBy="webLists")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="web_page_id", referencedColumnName="id")
* })
*/
private $webPage;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebEngine", inversedBy="webLists")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="web_engine_id", referencedColumnName="id")
* })
*/
private $webEngine;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="webListsStartSortOne")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="start_sort_one_id", referencedColumnName="id")
* })
*/
private $startSortOne;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="webListsStartSortTwo")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="start_sort_two_id", referencedColumnName="id")
* })
*/
private $startSortTwo;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="webListsStartSortThree")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="start_sort_three_id", referencedColumnName="id")
* })
*/
private $startSortThree;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="webListsSortBarOne")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="sort_bar_one_id", referencedColumnName="id")
* })
*/
private $sortBarOne;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="webListsSortBarTwo")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="sort_bar_two_id", referencedColumnName="id")
* })
*/
private $sortBarTwo;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\WebSort", inversedBy="webListsSortBarThree")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="sort_bar_three_id", referencedColumnName="id")
* })
*/
private $sortBarThree;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebListBlock", mappedBy="webList", cascade={"persist","remove"})
*/
private $blocks;
/**
* @var \App\Entity\Weblist
*
* @ORM\ManyToOne(targetEntity="App\Entity\WebList", inversedBy="childrens")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
* })
*/
private $parent;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebList", mappedBy="parent", cascade={"persist"})
*/
private $childrens;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="webLists")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
* })
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="webLists")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
* })
*/
private $entity;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="webLists")
*/
private $tags;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
*/
private $state;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $descriptionTranslations;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Annonce", mappedBy="webLists")
*/
private $annonces;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $title;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $titleTranslations;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $overTitle;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $overTitleTranslations;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $subTitle;
/**
* @ORM\Column(type="json", nullable=true)
*/
private $subTitleTranslations;
/**
* @ORM\ManyToOne(targetEntity=WebListTemplate::class, inversedBy="webLists")
*/
private $listTemplate;
/**
* @ORM\ManyToOne(targetEntity=WebListItemTemplate::class, inversedBy="webLists")
*/
private $listItemTemplate;
/**
* @ORM\OneToMany(targetEntity=WebListParameter::class, mappedBy="webList", orphanRemoval=true, cascade={"persist", "remove"})
*/
private $parameters;
/**
* @ORM\Column(type="string", length=255, options={"default" : "NONE"})
*/
private $duplicateProductsBy = 'NONE';
/**
* @ORM\ManyToOne(targetEntity=Site::class, inversedBy="weblists", cascade={"persist"})
* @ORM\JoinColumn(nullable=true)
*/
private $site;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Media", inversedBy="weblists")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="media_id", referencedColumnName="id")
* })
*/
private $image;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\ListModel", inversedBy="weblists")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="list_model_id", referencedColumnName="id")
* }) */
private $listModel;
public function __construct()
{
$this->childrens = new ArrayCollection();
$this->blocks = new ArrayCollection();
$this->tags = new ArrayCollection();
$this->annonces = new ArrayCollection();
$this->parameters = new ArrayCollection();
$this->originWebLists = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getPermalinkUrl(): ?string
{
return $this->permalinkUrl;
}
public function setPermalinkUrl(?string $permalinkUrl): self
{
$this->permalinkUrl = $permalinkUrl;
return $this;
}
public function getPermalinkIsCanonical(): ?bool
{
return $this->permalinkIsCanonical;
}
public function setPermalinkIsCanonical(?bool $permalinkIsCanonical): self
{
$this->permalinkIsCanonical = $permalinkIsCanonical;
return $this;
}
public function getDoNotCreateRewriteRuleForList(): ?bool
{
return $this->doNotCreateRewriteRuleForList;
}
public function setDoNotCreateRewriteRuleForList(?bool $doNotCreateRewriteRuleForList): self
{
$this->doNotCreateRewriteRuleForList = $doNotCreateRewriteRuleForList;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getState(): ?int
{
return $this->state;
}
public function setState(?int $state): self
{
$this->state = $state;
return $this;
}
public function getSelection(): ?Selection
{
return $this->selection;
}
public function setSelection(?Selection $selection): self
{
$this->selection = $selection;
return $this;
}
public function getWebPage(): ?WebPage
{
return $this->webPage;
}
public function setWebPage(?WebPage $webPage): self
{
$this->webPage = $webPage;
return $this;
}
public function getDestinationWebList(): ?WebList
{
return $this->destinationWebList;
}
public function setDestinationWebList(?WebList $webList): self
{
$this->destinationWebList = $webList;
return $this;
}
public function getWebEngine(): ?WebEngine
{
return $this->webEngine;
}
public function setWebEngine(?WebEngine $webEngine): self
{
$this->webEngine = $webEngine;
return $this;
}
public function getStartSortOne(): ?WebSort
{
return $this->startSortOne;
}
public function setStartSortOne(?WebSort $startSortOne): self
{
$this->startSortOne = $startSortOne;
return $this;
}
public function getStartSortTwo(): ?WebSort
{
return $this->startSortTwo;
}
public function setStartSortTwo(?WebSort $startSortTwo): self
{
$this->startSortTwo = $startSortTwo;
return $this;
}
public function getStartSortThree(): ?WebSort
{
return $this->startSortThree;
}
public function setStartSortThree(?WebSort $startSortThree): self
{
$this->startSortThree = $startSortThree;
return $this;
}
public function getSortBarOne(): ?WebSort
{
return $this->sortBarOne;
}
public function setSortBarOne(?WebSort $sortBarOne): self
{
$this->sortBarOne = $sortBarOne;
return $this;
}
public function getSortBarTwo(): ?WebSort
{
return $this->sortBarTwo;
}
public function setSortBarTwo(?WebSort $sortBarTwo): self
{
$this->sortBarTwo = $sortBarTwo;
return $this;
}
public function getSortBarThree(): ?WebSort
{
return $this->sortBarThree;
}
public function setSortBarThree(?WebSort $sortBarThree): self
{
$this->sortBarThree = $sortBarThree;
return $this;
}
public function getOwner(): ?User
{
return $this->owner;
}
public function setOwner(?User $owner): self
{
$this->owner = $owner;
return $this;
}
public function getEntity(): ?DnsitEntity
{
return $this->entity;
}
public function setEntity(?DnsitEntity $entity): self
{
$this->entity = $entity;
return $this;
}
public function getPermalinkUrlTranslation(): ?array
{
return $this->permalinkUrlTranslation;
}
public function setPermalinkUrlTranslation(?array $permalinkUrlTranslation): self
{
$this->permalinkUrlTranslation = $permalinkUrlTranslation;
return $this;
}
/**
* @return string
*/
public function getSlug(): ?string
{
return $this->slug;
}
/**
* @param string $slug
*/
public function setSlug(?string $slug): void
{
$this->slug = $slug;
}
public function getSlugTranslation(): ?array
{
return $this->slugTranslation;
}
public function setSlugTranslation(?array $slugTranslation): self
{
$this->slugTranslation = $slugTranslation;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getDescriptionTranslations(): ?array
{
return $this->descriptionTranslations;
}
public function setDescriptionTranslations(?array $descriptionTranslations): self
{
$this->descriptionTranslations = $descriptionTranslations;
return $this;
}
public function getParent(): ?self
{
return $this->parent;
}
public function setParent(?self $parent): self
{
$this->parent = $parent;
return $this;
}
/**
* @return Collection|WebListBlock[]
*/
public function getBlocks(): Collection
{
return $this->blocks;
}
public function addBlock(WebListBlock $block): self
{
if (!$this->blocks->contains($block)) {
$this->blocks[] = $block;
$block->setWebList($this);
}
return $this;
}
public function removeBlock(WebListBlock $block): self
{
if ($this->blocks->contains($block)) {
$this->blocks->removeElement($block);
// set the owning side to null (unless already changed)
if ($block->getWebList() === $this) {
$block->setWebList(null);
}
}
return $this;
}
/**
* @return Collection|WebList[]
*/
public function getOriginWebList(): Collection
{
return $this->originWebLists;
}
public function addOriginWebList(WebList $webList): self
{
if (!$this->originWebLists->contains($webList)) {
$this->originWebLists[] = $webList;
$webList->setDestinationWebList($this);
}
return $this;
}
public function removeOriginWebList(WebList $webList): self
{
if ($this->originWebLists->contains($webList)) {
$this->originWebLists->removeElement($webList);
// set the owning side to null (unless already changed)
if ($webList->getDestinationWebList() === $this) {
$webList->setDestinationWebList(null);
}
}
return $this;
}
/**
* @return Collection|WebList[]
*/
public function getChildrens(): Collection
{
return $this->childrens;
}
public function addChildren(WebList $children): self
{
if (!$this->childrens->contains($children)) {
$this->childrens[] = $children;
$children->setParent($this);
}
return $this;
}
public function removeChildren(WebList $children): self
{
if ($this->childrens->contains($children)) {
$this->childrens->removeElement($children);
// set the owning side to null (unless already changed)
if ($children->getParent() === $this) {
$children->setParent(null);
}
}
return $this;
}
/**
* @return Collection|Tag[]
*/
public function getTags(): Collection
{
return $this->tags;
}
public function addTag(Tag $tag): self
{
if (!$this->tags->contains($tag)) {
$this->tags[] = $tag;
}
return $this;
}
public function removeTag(Tag $tag): self
{
if ($this->tags->contains($tag)) {
$this->tags->removeElement($tag);
}
return $this;
}
/**
* @return Collection|Annonce[]
*/
public function getAnnonces(): Collection
{
return $this->annonces;
}
public function addAnnonce(Annonce $annonce): self
{
if (!$this->annonces->contains($annonce)) {
$this->annonces[] = $annonce;
}
return $this;
}
public function removeAnnonce(Annonce $annonce): self
{
if ($this->annonces->contains($annonce)) {
$this->annonces->removeElement($annonce);
}
return $this;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}
public function getTitleTranslations(): ?array
{
return $this->titleTranslations;
}
public function setTitleTranslations(?array $titleTranslations): self
{
$this->titleTranslations = $titleTranslations;
return $this;
}
public function getOverTitle(): ?string
{
return $this->overTitle;
}
public function setOverTitle(?string $overTitle): self
{
$this->overTitle = $overTitle;
return $this;
}
public function getOverTitleTranslations(): ?array
{
return $this->overTitleTranslations;
}
public function setOverTitleTranslations(?array $overTitleTranslations): self
{
$this->overTitleTranslations = $overTitleTranslations;
return $this;
}
public function getSubTitle(): ?string
{
return $this->subTitle;
}
public function setSubTitle(?string $subTitle): self
{
$this->subTitle = $subTitle;
return $this;
}
public function getSubTitleTranslations(): ?array
{
return $this->subTitleTranslations;
}
public function setSubTitleTranslations(?array $subTitleTranslations): self
{
$this->subTitleTranslations = $subTitleTranslations;
return $this;
}
public function getListTemplate(): ?WebListTemplate
{
return $this->listTemplate;
}
public function setListTemplate(?WebListTemplate $listTemplate): self
{
$this->listTemplate = $listTemplate;
return $this;
}
public function getListItemTemplate(): ?WebListItemTemplate
{
return $this->listItemTemplate;
}
public function setListItemTemplate(?WebListItemTemplate $listItemTemplate): self
{
$this->listItemTemplate = $listItemTemplate;
return $this;
}
/**
* @return Collection|WebListParameter[]
*/
public function getParameters(): Collection
{
return $this->parameters;
}
public function addParameter(WebListParameter $parameter): self
{
if (!$this->parameters->contains($parameter)) {
$this->parameters[] = $parameter;
$parameter->setWebList($this);
}
return $this;
}
public function removeParameter(WebListParameter $parameter): self
{
if ($this->parameters->removeElement($parameter)) {
// set the owning side to null (unless already changed)
if ($parameter->getWebList() === $this) {
$parameter->setWebList(null);
}
}
return $this;
}
public function getDuplicateProductsBy(): ?string
{
return $this->duplicateProductsBy;
}
public function setDuplicateProductsBy(?string $duplicateProductsBy): self
{
$this->duplicateProductsBy = $duplicateProductsBy;
return $this;
}
public function getSite(): ?Site
{
return $this->site;
}
public function setSite(?Site $site): self
{
$this->site = $site;
return $this;
}
public function getImage(): ?Media
{
return $this->image;
}
public function setImage(?Media $image): self
{
$this->image = $image;
return $this;
}
public function getListModel(): ?ListModel
{
return $this->listModel;
}
public function setListModel(?ListModel $listModel): self
{
$this->listModel = $listModel;
return $this;
}
}