src/Entity/FenceDictionary.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FenceDictionaryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Timestampable\Traits\TimestampableEntity;
  8. /**
  9.  * @ORM\Entity(repositoryClass=FenceDictionaryRepository::class)
  10.  */
  11. class FenceDictionary
  12. {
  13.     /**
  14.      * Hook timestampable behavior
  15.      * updates createdAt, updatedAt fields
  16.      */
  17.     use TimestampableEntity;
  18.     /**
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue
  21.      * @ORM\Column(type="integer")
  22.      */
  23.     private $id;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $type;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      */
  31.     private $alfenValue;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity=FenceColorDictionary::class, inversedBy="fence")
  34.      * @ORM\JoinColumn(nullable=false)
  35.      */
  36.     private $fenceColorDictionary;
  37.     /**
  38.      * @ORM\OneToMany(targetEntity=FenceOffer::class, mappedBy="fence")
  39.      */
  40.     private $fenceOffers;
  41.     /**
  42.      * @ORM\ManyToMany(targetEntity=FenceElementDictionary::class, mappedBy="fences", cascade={"persist"})
  43.      */
  44.     private $fenceElementDictionaries;
  45.     /**
  46.      * @ORM\Column(type="json")
  47.      */
  48.     private $defaultQuotationParameters = [];
  49.     /**
  50.      * @ORM\Column(type="string", length=255)
  51.      */
  52.     private $alfenModelValue;
  53.     /**
  54.      * @ORM\OneToMany(targetEntity=ElementSettings::class, mappedBy="fenceDictionary")
  55.      */
  56.     private $elementSettings;
  57.     public function __construct()
  58.     {
  59.         $this->fenceOffers = new ArrayCollection();
  60.         $this->fenceElementDictionaries = new ArrayCollection();
  61.         $this->elementSettings = new ArrayCollection();
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getType(): ?string
  68.     {
  69.         return $this->type;
  70.     }
  71.     public function setType(string $type): self
  72.     {
  73.         $this->type $type;
  74.         return $this;
  75.     }
  76.     public function getAlfenValue(): ?string
  77.     {
  78.         return $this->alfenValue;
  79.     }
  80.     public function setAlfenValue(string $alfenValue): self
  81.     {
  82.         $this->alfenValue $alfenValue;
  83.         return $this;
  84.     }
  85.     public function getFenceColorDictionary(): ?FenceColorDictionary
  86.     {
  87.         return $this->fenceColorDictionary;
  88.     }
  89.     public function setFenceColorDictionary(?FenceColorDictionary $fenceColorDictionary): self
  90.     {
  91.         $this->fenceColorDictionary $fenceColorDictionary;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Collection<int, FenceOffer>
  96.      */
  97.     public function getFenceOffers(): Collection
  98.     {
  99.         return $this->fenceOffers;
  100.     }
  101.     public function addFenceOffer(FenceOffer $fenceOffer): self
  102.     {
  103.         if (!$this->fenceOffers->contains($fenceOffer)) {
  104.             $this->fenceOffers[] = $fenceOffer;
  105.             $fenceOffer->setFence($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removeFenceOffer(FenceOffer $fenceOffer): self
  110.     {
  111.         if ($this->fenceOffers->removeElement($fenceOffer)) {
  112.             // set the owning side to null (unless already changed)
  113.             if ($fenceOffer->getFence() === $this) {
  114.                 $fenceOffer->setFence(null);
  115.             }
  116.         }
  117.         return $this;
  118.     }
  119.     /**
  120.      * @return Collection<int, FenceElementDictionary>
  121.      */
  122.     public function getFenceElementDictionaries(): Collection
  123.     {
  124.         return $this->fenceElementDictionaries;
  125.     }
  126.     public function addFenceElementDictionary(FenceElementDictionary $fenceElementDictionary): self
  127.     {
  128.         if (!$this->fenceElementDictionaries->contains($fenceElementDictionary)) {
  129.             $this->fenceElementDictionaries[] = $fenceElementDictionary;
  130.             $fenceElementDictionary->addFence($this);
  131.         }
  132.         return $this;
  133.     }
  134.     public function removeFenceElementDictionary(FenceElementDictionary $fenceElementDictionary): self
  135.     {
  136.         if ($this->fenceElementDictionaries->removeElement($fenceElementDictionary)) {
  137.             $fenceElementDictionary->removeFence($this);
  138.         }
  139.         return $this;
  140.     }
  141.     public function __toString()
  142.     {
  143.         return $this->alfenModelValue;
  144.     }
  145.     public function getDefaultQuotationParameters(): ?array
  146.     {
  147.         return $this->defaultQuotationParameters;
  148.     }
  149.     public function setDefaultQuotationParameters(array $defaultQuotationParameters): self
  150.     {
  151.         $this->defaultQuotationParameters $defaultQuotationParameters;
  152.         return $this;
  153.     }
  154.     public function getAlfenModelValue(): ?string
  155.     {
  156.         return $this->alfenModelValue;
  157.     }
  158.     public function setAlfenModelValue(string $alfenModelValue): self
  159.     {
  160.         $this->alfenModelValue $alfenModelValue;
  161.         return $this;
  162.     }
  163.     /**
  164.      * @return Collection<int, ElementSettings>
  165.      */
  166.     public function getElementSettings(): Collection
  167.     {
  168.         return $this->elementSettings;
  169.     }
  170.     public function addElementSetting(ElementSettings $elementSetting): self
  171.     {
  172.         if (!$this->elementSettings->contains($elementSetting)) {
  173.             $this->elementSettings[] = $elementSetting;
  174.             $elementSetting->setFenceDictionary($this);
  175.         }
  176.         return $this;
  177.     }
  178.     public function removeElementSetting(ElementSettings $elementSetting): self
  179.     {
  180.         if ($this->elementSettings->removeElement($elementSetting)) {
  181.             // set the owning side to null (unless already changed)
  182.             if ($elementSetting->getFenceDictionary() === $this) {
  183.                 $elementSetting->setFenceDictionary(null);
  184.             }
  185.         }
  186.         return $this;
  187.     }
  188. }