src/Entity/BridgeParameter.php line 11

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\BridgeParameterRepository")
  8.  */
  9. class BridgeParameter
  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)
  19.      */
  20.     private $label;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, unique=true)
  23.      */
  24.     private $key;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private $defaultValue;
  29.     /**
  30.      * @ORM\Column(type="integer", nullable=true)
  31.      */
  32.     private $ordering;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=true)
  35.      */
  36.     private $helpText;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity="App\Entity\BridgeParameterGroup", inversedBy="parameters")
  39.      */
  40.     private $parameterGroup;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $type;
  45.     /**
  46.      * @ORM\Column(type="json", nullable=true)
  47.      */
  48.     private $options = [];
  49.     /**
  50.      * @ORM\Column(type="json", nullable=true)
  51.      */
  52.     private $value = [];
  53.     /**
  54.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="bridgeParameters")
  55.      * @ORM\JoinColumns({
  56.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  57.      * })
  58.      */
  59.     // private $owner;
  60.     /**
  61.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="bridgeParameters")
  62.      * @ORM\JoinColumns({
  63.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  64.      * })
  65.      */
  66.     // private $entity;
  67.     /**
  68.      * @ORM\OneToMany(targetEntity=WebListParameter::class, mappedBy="bridgeParameter", orphanRemoval=true)
  69.      */
  70.     private $webListParameters;
  71.     /**
  72.      * @ORM\OneToMany(targetEntity=WebSiteParameter::class, mappedBy="bridgeParameter", orphanRemoval=true)
  73.      */
  74.     private $webSiteParameters;
  75.     /**
  76.      * @ORM\OneToMany(targetEntity=WebPageParameter::class, mappedBy="bridgeParameter", orphanRemoval=true)
  77.      */
  78.     private $webPageParameters;
  79.     /**
  80.      * @ORM\OneToMany(targetEntity=BridgeUserParameter::class, mappedBy="parameter", orphanRemoval=true)
  81.      */
  82.     private $userParameters;
  83.     /**
  84.      * @ORM\Column(type="boolean", nullable=true, options={"default":false})
  85.      */
  86.     private ?bool $usableByEntitiesAdmins false;
  87.     public function __construct()
  88.     {
  89.         $this->webSiteParameters = new ArrayCollection();
  90.         $this->webListParameters = new ArrayCollection();
  91.         $this->webPageParameters = new ArrayCollection();
  92.         $this->userParameters = new ArrayCollection();
  93.     }
  94.     public function getId() : ?int
  95.     {
  96.         return $this->id;
  97.     }
  98.     public function getLabel() : ?string
  99.     {
  100.         return $this->label;
  101.     }
  102.     public function setLabel(?string $label) : self
  103.     {
  104.         $this->label $label;
  105.         return $this;
  106.     }
  107.     public function getKey() : ?string
  108.     {
  109.         return $this->key;
  110.     }
  111.     public function setKey(?string $key) : self
  112.     {
  113.         $this->key $key;
  114.         return $this;
  115.     }
  116.     public function getUsableByEntitiesAdmins(): ?bool
  117.     {
  118.         return $this->usableByEntitiesAdmins;
  119.     }
  120.     public function setUsableByEntitiesAdmins(?bool $usableByEntitiesAdmins): self
  121.     {
  122.         $this->usableByEntitiesAdmins $usableByEntitiesAdmins;
  123.         return $this;
  124.     }
  125.     public function getDefaultValue() : ?string
  126.     {
  127.         return $this->defaultValue;
  128.     }
  129.     public function setDefaultValue(?string $defaultValue) : self
  130.     {
  131.         $this->defaultValue $defaultValue;
  132.         return $this;
  133.     }
  134.     public function getOrdering() : ?int
  135.     {
  136.         return $this->ordering;
  137.     }
  138.     public function setOrdering(?int $ordering) : self
  139.     {
  140.         $this->ordering $ordering;
  141.         return $this;
  142.     }
  143.     public function getHelpText() : ?string
  144.     {
  145.         return $this->helpText;
  146.     }
  147.     public function setHelpText(?string $helpText) : self
  148.     {
  149.         $this->helpText $helpText;
  150.         return $this;
  151.     }
  152.     public function getParameterGroup() : ?BridgeParameterGroup
  153.     {
  154.         return $this->parameterGroup;
  155.     }
  156.     public function setParameterGroup(?BridgeParameterGroup $parameterGroup) : self
  157.     {
  158.         $this->parameterGroup $parameterGroup;
  159.         return $this;
  160.     }
  161.     public function getType() : ?string
  162.     {
  163.         return $this->type;
  164.     }
  165.     public function setType(?string $type) : self
  166.     {
  167.         $this->type $type;
  168.         return $this;
  169.     }
  170.     public function getOptions() : ?array
  171.     {
  172.         return $this->options;
  173.     }
  174.     public function setOptions(?array $options) : self
  175.     {
  176.         $this->options $options;
  177.         return $this;
  178.     }
  179.     public function getValue() : ?array
  180.     {
  181.         return $this->value;
  182.     }
  183.     public function setValue(?array $value) : self
  184.     {
  185.         $this->value $value;
  186.         return $this;
  187.     }
  188.     /**
  189.      * @return Collection|WebListParameter[]
  190.      */
  191.     public function getWebListParameters() : Collection
  192.     {
  193.         return $this->webListParameters;
  194.     }
  195.     public function addWebListParameter(WebListParameter $webListParameter) : self
  196.     {
  197.         if (!$this->webListParameters->contains($webListParameter)) {
  198.             $this->webListParameters[] = $webListParameter;
  199.             $webListParameter->setBridgeParameter($this);
  200.         }
  201.         return $this;
  202.     }
  203.     public function removeWebListParameter(WebListParameter $webListParameter) : self
  204.     {
  205.         if ($this->webListParameters->removeElement($webListParameter)) {
  206.             // set the owning side to null (unless already changed)
  207.             if ($webListParameter->getBridgeParameter() === $this) {
  208.                 $webListParameter->setBridgeParameter(null);
  209.             }
  210.         }
  211.         return $this;
  212.     }
  213.     /**
  214.      * @return Collection|BridgeUserParameter[]
  215.      */
  216.     public function getUserParameters() : Collection
  217.     {
  218.         return $this->userParameters;
  219.     }
  220.     public function addUserParameter(BridgeUserParameter $userParameter) : self
  221.     {
  222.         if (!$this->userParameters->contains($userParameter)) {
  223.             $this->userParameters[] = $userParameter;
  224.             $userParameter->setParameter($this);
  225.         }
  226.         return $this;
  227.     }
  228.     public function removeUserParameter(BridgeUserParameter $userParameter) : self
  229.     {
  230.         if ($this->userParameters->removeElement($userParameter)) {
  231.             // set the owning side to null (unless already changed)
  232.             if ($userParameter->getParameter() === $this) {
  233.                 $userParameter->setParameter(null);
  234.             }
  235.         }
  236.         return $this;
  237.     }
  238.     /**
  239.      * @return Collection|WebListParameter[]
  240.      */
  241.     public function getWebSiteParameters() : Collection
  242.     {
  243.         return $this->webSiteParameters;
  244.     }
  245.     public function addWebSiteParameter(WebSiteParameter $webSiteParameter) : self
  246.     {
  247.         if (!$this->webSiteParameters->contains($webSiteParameter)) {
  248.             $this->webSiteParameters[] = $webSiteParameter;
  249.             $webSiteParameter->setBridgeParameter($this);
  250.         }
  251.         return $this;
  252.     }
  253.     public function removeWebSiteParameter(WebSiteParameter $webSiteParameter) : self
  254.     {
  255.         if ($this->webSiteParameters->removeElement($webSiteParameter)) {
  256.             // set the owning side to null (unless already changed)
  257.             if ($webSiteParameter->getBridgeParameter() === $this) {
  258.                 $webSiteParameter->setBridgeParameter(null);
  259.             }
  260.         }
  261.         return $this;
  262.     }
  263.     /**
  264.      * @return Collection|WebPageParameter[]
  265.      */
  266.     public function getWebPageParameters() : Collection
  267.     {
  268.         return $this->webPageParameters;
  269.     }
  270.     public function addWebPageParameter(WebPageParameter $webPageParameter) : self
  271.     {
  272.         if (!$this->webPageParameters->contains($webPageParameter)) {
  273.             $this->webPageParameters[] = $webPageParameter;
  274.             $webPageParameter->setBridgeParameter($this);
  275.         }
  276.         return $this;
  277.     }
  278.     public function removeWebPageParameter(WebPageParameter $webPageParameter) : self
  279.     {
  280.         if ($this->webPageParameters->removeElement($webPageParameter)) {
  281.             // set the owning side to null (unless already changed)
  282.             if ($webPageParameter->getBridgeParameter() === $this) {
  283.                 $webPageParameter->setBridgeParameter(null);
  284.             }
  285.         }
  286.         return $this;
  287.     }
  288.     public function getForWeb()
  289.     {
  290.         return ['id' => $this->getId(), 'key' => $this->getKey(), 'label' => $this->getLabel(), 'ordering' => $this->getOrdering(), 'value' => $this->getValue()];
  291.     }
  292. /*
  293.     public function getOwner(): ?User
  294.     {
  295.         return $this->owner;
  296.     }
  297.     public function setOwner(?User $owner): self
  298.     {
  299.         $this->owner = $owner;
  300.         return $this;
  301.     }
  302.     public function getEntity(): ?DnsitEntity
  303.     {
  304.         return $this->entity;
  305.     }
  306.     public function setEntity(?DnsitEntity $entity): self
  307.     {
  308.         $this->entity = $entity;
  309.         return $this;
  310.     }
  311. */
  312. }