src/Entity/WebFilter.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity (repositoryClass="App\Repository\WebFilterRepository")
  8.  */
  9. class WebFilter
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du filtre"})
  19.      */
  20.     private $name;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé à afficher - facultatif"})
  23.      */
  24.     private $label;
  25.     /**
  26.      * @ORM\Column(type="json", nullable=true)
  27.      */
  28.     private $labelTranslations;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"code de type de champ prédéfini en dur dans le code"})
  31.      */
  32.     private $filterField;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"code de type d'affichage prédéfini en dur dans le code"})
  35.      */
  36.     private $displayType;
  37.     /**
  38.      * @var \Doctrine\Common\Collections\Collection
  39.      *
  40.      * @ORM\OneToMany(targetEntity="App\Entity\WebFilterItem", mappedBy="filter", cascade={"persist","remove"}, orphanRemoval=true)
  41.      * @ORM\OrderBy({"ordering" = "ASC"})
  42.      */
  43.     private $items;
  44.     /**
  45.      * @var \Doctrine\Common\Collections\Collection
  46.      *
  47.      * @ORM\OneToMany(targetEntity="App\Entity\WebSubSectionFilter", mappedBy="filter", cascade={"persist"}, orphanRemoval=true)
  48.      * @ORM\OrderBy({"ordering" = "ASC"})
  49.      */
  50.     private $subSections;
  51.     /**
  52.      * @ORM\Column(type="json", nullable=true)
  53.      */
  54.     private $parameters;
  55.     /**
  56.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="webFilters")
  57.      * @ORM\JoinColumns({
  58.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  59.      * })
  60.      */
  61.     private $owner;
  62.     /**
  63.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="webFilters")
  64.      * @ORM\JoinColumns({
  65.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  66.      * })
  67.      */
  68.     private $entity;
  69.     /**
  70.      * @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="webFilters")
  71.      */
  72.     private $tags;
  73.     /**
  74.      * @ORM\Column(type="datetime", nullable=true)
  75.      */
  76.     private $createdAt;
  77.     /**
  78.      * @ORM\Column(type="datetime", nullable=true)
  79.      */
  80.     private $updatedAt;
  81.     /**
  82.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  83.      */
  84.     private $state;
  85.     /**
  86.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Opérateur du filtre"})
  87.      */
  88.     private $operator;
  89.     public function __construct()
  90.     {
  91.         $this->items = new ArrayCollection();
  92.         $this->subSections = new ArrayCollection();
  93.         $this->tags = new ArrayCollection();
  94.     }
  95.     public function getId() : ?int
  96.     {
  97.         return $this->id;
  98.     }
  99.     public function getName() : ?string
  100.     {
  101.         return $this->name;
  102.     }
  103.     public function setName(?string $name) : self
  104.     {
  105.         $this->name $name;
  106.         return $this;
  107.     }
  108.     public function getParameters() : ?array
  109.     {
  110.         return $this->parameters;
  111.     }
  112.     public function setParameters(?array $parameters) : self
  113.     {
  114.         $this->parameters $parameters;
  115.         return $this;
  116.     }
  117.     public function getLabel() : ?string
  118.     {
  119.         return $this->label;
  120.     }
  121.     public function setLabel(?string $label) : self
  122.     {
  123.         $this->label $label;
  124.         return $this;
  125.     }
  126.     public function getLabelTranslations() : ?array
  127.     {
  128.         return $this->labelTranslations;
  129.     }
  130.     public function setLabelTranslations(?array $labelTranslations) : self
  131.     {
  132.         $this->labelTranslations $labelTranslations;
  133.         return $this;
  134.     }
  135.     public function getFilterField() : ?string
  136.     {
  137.         return $this->filterField;
  138.     }
  139.     public function setFilterField(?string $filterField) : self
  140.     {
  141.         $this->filterField $filterField;
  142.         return $this;
  143.     }
  144.     public function getDisplayType() : ?string
  145.     {
  146.         return $this->displayType;
  147.     }
  148.     public function setDisplayType(?string $displayType) : self
  149.     {
  150.         $this->displayType $displayType;
  151.         return $this;
  152.     }
  153.     public function getCreatedAt() : ?\DateTimeInterface
  154.     {
  155.         return $this->createdAt;
  156.     }
  157.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  158.     {
  159.         $this->createdAt $createdAt;
  160.         return $this;
  161.     }
  162.     public function getUpdatedAt() : ?\DateTimeInterface
  163.     {
  164.         return $this->updatedAt;
  165.     }
  166.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  167.     {
  168.         $this->updatedAt $updatedAt;
  169.         return $this;
  170.     }
  171.     public function getState() : ?int
  172.     {
  173.         return $this->state;
  174.     }
  175.     public function setState(?int $state) : self
  176.     {
  177.         $this->state $state;
  178.         return $this;
  179.     }
  180.     public function getOwner() : ?User
  181.     {
  182.         return $this->owner;
  183.     }
  184.     public function setOwner(?User $owner) : self
  185.     {
  186.         $this->owner $owner;
  187.         return $this;
  188.     }
  189.     public function getEntity() : ?DnsitEntity
  190.     {
  191.         return $this->entity;
  192.     }
  193.     public function setEntity(?DnsitEntity $entity) : self
  194.     {
  195.         $this->entity $entity;
  196.         return $this;
  197.     }
  198.     /**
  199.      * @return Collection|WebFilterItem[]
  200.      */
  201.     public function getItems() : Collection
  202.     {
  203.         return $this->items;
  204.     }
  205.     public function addItem(WebFilterItem $item) : self
  206.     {
  207.         if (!$this->items->contains($item)) {
  208.             $this->items[] = $item;
  209.             $item->setFilter($this);
  210.         }
  211.         return $this;
  212.     }
  213.     public function removeItem(WebFilterItem $item) : self
  214.     {
  215.         if ($this->items->contains($item)) {
  216.             $this->items->removeElement($item);
  217.             // set the owning side to null (unless already changed)
  218.             if ($item->getFilter() === $this) {
  219.                 $item->setFilter(null);
  220.             }
  221.         }
  222.         return $this;
  223.     }
  224.     /**
  225.      * @return Collection|WebSubSectionFilter[]
  226.      */
  227.     public function getSubSections() : Collection
  228.     {
  229.         return $this->subSections;
  230.     }
  231.     public function addSubSection(WebSubSectionFilter $subSectionFilter) : self
  232.     {
  233.         if (!$this->subSections->contains($subSectionFilter)) {
  234.             $this->subSections[] = $subSectionFilter;
  235.             $subSectionFilter->setFilter($this);
  236.         }
  237.         return $this;
  238.     }
  239.     public function removeSubSection(WebSubSectionFilter $subSectionFilter) : self
  240.     {
  241.         if ($this->subSections->contains($subSectionFilter)) {
  242.             $this->subSections->removeElement($subSectionFilter);
  243.             // set the owning side to null (unless already changed)
  244.             if ($subSectionFilter->getFilter() === $this) {
  245.                 $subSectionFilter->setFilter(null);
  246.             }
  247.         }
  248.         return $this;
  249.     }
  250.     /**
  251.      * @return Collection|Tag[]
  252.      */
  253.     public function getTags() : Collection
  254.     {
  255.         return $this->tags;
  256.     }
  257.     public function addTag(Tag $tag) : self
  258.     {
  259.         if (!$this->tags->contains($tag)) {
  260.             $this->tags[] = $tag;
  261.         }
  262.         return $this;
  263.     }
  264.     public function removeTag(Tag $tag) : self
  265.     {
  266.         if ($this->tags->contains($tag)) {
  267.             $this->tags->removeElement($tag);
  268.         }
  269.         return $this;
  270.     }
  271.     public function getOperator() : ?string
  272.     {
  273.         return $this->operator;
  274.     }
  275.     public function setOperator(?string $operator) : self
  276.     {
  277.         $this->operator $operator;
  278.         return $this;
  279.     }
  280. }