src/Entity/ElementSettings.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ElementSettingsRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ElementSettingsRepository::class)
  9.  */
  10. class ElementSettings
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="json")
  20.      */
  21.     private $defaultQuotationParameters = [];
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=FenceDictionary::class, inversedBy="elementSettings")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $fenceDictionary;
  27.     /**
  28.      * @ORM\Column(type="string", length=255)
  29.      */
  30.     private $name;
  31.     /**
  32.      * @ORM\Column(type="integer", options={"default": 0})
  33.      */
  34.     private $sortOrder;
  35.     /**
  36.      * @ORM\OneToMany(targetEntity=Standard::class, mappedBy="fence")
  37.      */
  38.     private $standards;
  39.     public function __construct()
  40.     {
  41.         $this->standards = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getDefaultQuotationParameters(): ?array
  48.     {
  49.         return $this->defaultQuotationParameters;
  50.     }
  51.     public function setDefaultQuotationParameters(array $defaultQuotationParameters): self
  52.     {
  53.         $this->defaultQuotationParameters $defaultQuotationParameters;
  54.         return $this;
  55.     }
  56.     public function getFenceDictionary(): ?FenceDictionary
  57.     {
  58.         return $this->fenceDictionary;
  59.     }
  60.     public function setFenceDictionary(?FenceDictionary $fenceDictionary): self
  61.     {
  62.         $this->fenceDictionary $fenceDictionary;
  63.         return $this;
  64.     }
  65.     public function getName(): ?string
  66.     {
  67.         return $this->name;
  68.     }
  69.     public function setName(string $name): self
  70.     {
  71.         $this->name $name;
  72.         return $this;
  73.     }
  74.     public function __toString()
  75.     {
  76.         return $this->name;
  77.     }
  78.     public function getSortOrder(): ?int
  79.     {
  80.         return $this->sortOrder;
  81.     }
  82.     public function setSortOrder(int $sortOrder): self
  83.     {
  84.         $this->sortOrder $sortOrder;
  85.         return $this;
  86.     }
  87.     /**
  88.      * @return Collection<int, Standard>
  89.      */
  90.     public function getStandards(): Collection
  91.     {
  92.         return $this->standards;
  93.     }
  94.     public function addStandard(Standard $standard): self
  95.     {
  96.         if (!$this->standards->contains($standard)) {
  97.             $this->standards[] = $standard;
  98.             $standard->setFence($this);
  99.         }
  100.         return $this;
  101.     }
  102.     public function removeStandard(Standard $standard): self
  103.     {
  104.         if ($this->standards->removeElement($standard)) {
  105.             // set the owning side to null (unless already changed)
  106.             if ($standard->getFence() === $this) {
  107.                 $standard->setFence(null);
  108.             }
  109.         }
  110.         return $this;
  111.     }
  112. }