src/Entity/WebFilterItem.php line 12

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\WebFilterItemRepository")
  8.  */
  9. class WebFilterItem
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\WebFilter", inversedBy="items")
  19.      * @ORM\JoinColumns({
  20.      *   @ORM\JoinColumn(name="filter_id", referencedColumnName="id", onDelete="CASCADE")
  21.      * })
  22.      */
  23.     private $filter;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Intitulé"})
  26.      */
  27.     private $label;
  28.     /**
  29.      * @ORM\Column(type="json", nullable=true)
  30.      */
  31.     private $labelTranslations;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity="App\Entity\Media", inversedBy="filterItems")
  34.      * @ORM\JoinColumns({
  35.      *   @ORM\JoinColumn(name="media_id", referencedColumnName="id")
  36.      * })
  37.      */
  38.     private $image;
  39.     /**
  40.      * 
  41.      * @deprecated on le garde pour des raisons de compatibilités et pour pas perdre de données, mais faut plus s'en servir
  42.      * 
  43.      * @ORM\Column(type="json", nullable=true, options={"comment":"modalité(s)"})
  44.      */
  45.     private $modality;
  46.     /**
  47.      * @ORM\ManyToMany(targetEntity="App\Entity\DnsitModality", inversedBy="filterItems", cascade={"persist"})
  48.      */
  49.     private $modalities;
  50.     /**
  51.      * @ORM\ManyToMany(targetEntity="App\Entity\DnsitCriterion", inversedBy="filterItems", cascade={"persist"})
  52.      */
  53.     private $criterions;
  54.     /**
  55.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"min"})
  56.      */
  57.     private $min;
  58.     /**
  59.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"max"})
  60.      */
  61.     private $max;
  62.     /**
  63.      * @ORM\Column(type="string", length=255, nullable=true, options={"comment":"intervalle"})
  64.      */
  65.     private $interval;
  66.     /**
  67.      * @ORM\Column(type="json", nullable=true, options={"comment":"options"})
  68.      */
  69.     private $options;
  70.     /**
  71.      * @ORM\Column(type="json", nullable=true, options={"comment":"parametres"})
  72.      */
  73.     private $params;
  74.     /**
  75.      * @ORM\Column(type="integer", nullable=true)
  76.      */
  77.     private $ordering;
  78.     /**
  79.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="webFilterItems")
  80.      * @ORM\JoinColumns({
  81.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  82.      * })
  83.      */
  84.     private $owner;
  85.     /**
  86.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="webFilterItems")
  87.      * @ORM\JoinColumns({
  88.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  89.      * })
  90.      */
  91.     private $entity;
  92.     /**
  93.      * @ORM\Column(type="datetime", nullable=true)
  94.      */
  95.     private $createdAt;
  96.     /**
  97.      * @ORM\Column(type="datetime", nullable=true)
  98.      */
  99.     private $updatedAt;
  100.     /**
  101.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  102.      */
  103.     private $state;
  104.     
  105.     /**
  106.      * @var \Doctrine\Common\Collections\Collection
  107.      * @ORM\OneToMany(targetEntity="App\Entity\WebFilterResult", mappedBy="filterItem")
  108.      */
  109.     private $webFilterResults;
  110.     
  111.     public function __construct() {
  112.         $this->modalities = new ArrayCollection();
  113.         $this->criterions = new ArrayCollection();
  114.         $this->webFilterResults = new ArrayCollection();
  115.     }
  116.     public function getId() : ?int
  117.     {
  118.         return $this->id;
  119.     }
  120.     public function getLabel() : ?string
  121.     {
  122.         return $this->label;
  123.     }
  124.     public function setLabel(?string $label) : self
  125.     {
  126.         $this->label $label;
  127.         return $this;
  128.     }
  129.     public function getLabelTranslations() : ?array
  130.     {
  131.         return $this->labelTranslations;
  132.     }
  133.     public function setLabelTranslations(?array $labelTranslations) : self
  134.     {
  135.         $this->labelTranslations $labelTranslations;
  136.         return $this;
  137.     }
  138.     public function getModality() : ?array
  139.     {
  140.         return $this->modality;
  141.     }
  142.     public function setModality(?array $modality) : self
  143.     {
  144.         $this->modality $modality;
  145.         return $this;
  146.     }
  147.     public function getMin() : ?string
  148.     {
  149.         return $this->min;
  150.     }
  151.     public function setMin(?string $min) : self
  152.     {
  153.         $this->min $min;
  154.         return $this;
  155.     }
  156.     public function getMax() : ?string
  157.     {
  158.         return $this->max;
  159.     }
  160.     public function setMax(?string $max) : self
  161.     {
  162.         $this->max $max;
  163.         return $this;
  164.     }
  165.     public function getInterval() : ?string
  166.     {
  167.         return $this->interval;
  168.     }
  169.     public function setInterval(?string $interval) : self
  170.     {
  171.         $this->interval $interval;
  172.         return $this;
  173.     }
  174.     public function getParams() : ?array
  175.     {
  176.         return $this->params;
  177.     }
  178.     public function setParams(?array $params) : self
  179.     {
  180.         $this->params $params;
  181.         return $this;
  182.     }
  183.     public function getCreatedAt() : ?\DateTimeInterface
  184.     {
  185.         return $this->createdAt;
  186.     }
  187.     public function setCreatedAt(?\DateTimeInterface $createdAt) : self
  188.     {
  189.         $this->createdAt $createdAt;
  190.         return $this;
  191.     }
  192.     public function getUpdatedAt() : ?\DateTimeInterface
  193.     {
  194.         return $this->updatedAt;
  195.     }
  196.     public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
  197.     {
  198.         $this->updatedAt $updatedAt;
  199.         return $this;
  200.     }
  201.     public function getState() : ?int
  202.     {
  203.         return $this->state;
  204.     }
  205.     public function setState(?int $state) : self
  206.     {
  207.         $this->state $state;
  208.         return $this;
  209.     }
  210.     public function getFilter() : ?WebFilter
  211.     {
  212.         return $this->filter;
  213.     }
  214.     public function setFilter(?WebFilter $filter) : self
  215.     {
  216.         $this->filter $filter;
  217.         return $this;
  218.     }
  219.     public function getImage() : ?Media
  220.     {
  221.         return $this->image;
  222.     }
  223.     public function setImage(?Media $image) : self
  224.     {
  225.         $this->image $image;
  226.         return $this;
  227.     }
  228.     public function getOwner() : ?User
  229.     {
  230.         return $this->owner;
  231.     }
  232.     public function setOwner(?User $owner) : self
  233.     {
  234.         $this->owner $owner;
  235.         return $this;
  236.     }
  237.     public function getEntity() : ?DnsitEntity
  238.     {
  239.         return $this->entity;
  240.     }
  241.     public function setEntity(?DnsitEntity $entity) : self
  242.     {
  243.         $this->entity $entity;
  244.         return $this;
  245.     }
  246.     public function getOrdering() : ?int
  247.     {
  248.         return $this->ordering;
  249.     }
  250.     public function setOrdering(?int $ordering) : self
  251.     {
  252.         $this->ordering $ordering;
  253.         return $this;
  254.     }
  255.     public function getOptions() : ?array
  256.     {
  257.         return $this->options;
  258.     }
  259.     public function setOptions(?array $options) : self
  260.     {
  261.         $this->options $options;
  262.         return $this;
  263.     }
  264.     /**
  265.      * @return Collection|DnsitModality[]
  266.      */
  267.     public function getModalities() : Collection
  268.     {
  269.         return $this->modalities;
  270.     }
  271.     public function addModality(DnsitModality $modality) : self
  272.     {
  273.         if (!$this->modalities->contains($modality)) {
  274.             $this->modalities[] = $modality;
  275.             $modality->addFilterItem($this);
  276.         }
  277.         return $this;
  278.     }
  279.     public function removeModality(DnsitModality $modality) : self
  280.     {
  281.         if ($this->modalities->contains($modality)) {
  282.             $this->modalities->removeElement($modality);
  283.             $modality->removeFilterItem($this);
  284.         }
  285.         return $this;
  286.     }
  287.     /**
  288.      * @return Collection|DnsitCriterion[]
  289.      */
  290.     public function getCriterions() : Collection
  291.     {
  292.         return $this->criterions;
  293.     }
  294.     public function addCriterion(DnsitCriterion $criterion) : self
  295.     {
  296.         if (!$this->criterions->contains($criterion)) {
  297.             $this->criterions[] = $criterion;
  298.             $criterion->addFilterItem($this);
  299.         }
  300.         return $this;
  301.     }
  302.     public function removeCriterion(DnsitCriterion $criterion) : self
  303.     {
  304.         if ($this->criterions->contains($criterion)) {
  305.             $this->criterions->removeElement($criterion);
  306.             $criterion->removeFilterItem($this);
  307.         }
  308.         return $this;
  309.     }
  310.     /**
  311.      * @return Collection|WebFilterResult[]
  312.      */
  313.     public function getWebFilterResults() : Collection
  314.     {
  315.         return $this->webFilterResults;
  316.     }
  317.     public function addWebFilterResult(WebFilterResult $webFilterResult) : self
  318.     {
  319.         if (!$this->webFilterResults->contains($webFilterResult)) {
  320.             $this->webFilterResults[] = $webFilterResult;
  321.             $webFilterResult->setFilterItem($this);
  322.         }
  323.         return $this;
  324.     }
  325.     public function removeWebFilterResult(WebFilterResult $webFilterResult) : self
  326.     {
  327.         if ($this->webFilterResults->contains($webFilterResult)) {
  328.             $this->webFilterResults->removeElement($webFilterResult);
  329.             // set the owning side to null (unless already changed)
  330.             if ($webFilterResult->getFilterItem() === $this) {
  331.                 $webFilterResult->setFilterItem(null);
  332.             }
  333.         }
  334.         return $this;
  335.     }
  336. }