src/Entity/FenceElementDictionary.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FenceElementDictionaryRepository;
  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=FenceElementDictionaryRepository::class)
  10.  */
  11. class FenceElementDictionary
  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 $name;
  28.     /**
  29.      * @ORM\Column(type="json")
  30.      */
  31.     private $formConfigJson = [];
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      */
  35.     private $alfenValue;
  36.     /**
  37.      * @ORM\OneToMany(targetEntity=File::class, mappedBy="fenceElement")
  38.      */
  39.     private $files;
  40.     /**
  41.      * @ORM\ManyToMany(targetEntity=FenceDictionary::class, inversedBy="fenceElementDictionaries")
  42.      */
  43.     private $fences;
  44.     private $placementOption
  45.     private $placementType;
  46.     private $placementPoint;
  47.     /**
  48.      * @var array|null
  49.      */
  50.     private $formData;
  51.     /**
  52.      * @ORM\Column(type="string", length=255, nullable=true)
  53.      */
  54.     private $type;
  55.     /**
  56.      * @ORM\Column(type="string", length=255, nullable=true)
  57.      */
  58.     private $elementType;
  59.     /**
  60.      * @ORM\Column(type="string", length=255, nullable=true)
  61.      */
  62.     private $englishName;
  63.     public function __construct()
  64.     {
  65.         $this->files = new ArrayCollection();
  66.         $this->fences = new ArrayCollection();
  67.     }
  68.     public function getId(): ?int
  69.     {
  70.         return $this->id;
  71.     }
  72.     public function getName(): ?string
  73.     {
  74.         return $this->name;
  75.     }
  76.     public function setName(string $name): self
  77.     {
  78.         $this->name $name;
  79.         return $this;
  80.     }
  81.     public function getFormConfigJson(): ?array
  82.     {
  83.         return $this->formConfigJson;
  84.     }
  85.     public function setFormConfigJson(array $formConfigJson): self
  86.     {
  87.         $this->formConfigJson $formConfigJson;
  88.         return $this;
  89.     }
  90.     public function getAlfenValue(): ?string
  91.     {
  92.         return $this->alfenValue;
  93.     }
  94.     public function setAlfenValue(string $alfenValue): self
  95.     {
  96.         $this->alfenValue $alfenValue;
  97.         return $this;
  98.     }
  99.     /**
  100.      * @return Collection<int, File>
  101.      */
  102.     public function getFiles(): Collection
  103.     {
  104.         return $this->files;
  105.     }
  106.     public function addFile(File $file): self
  107.     {
  108.         if (!$this->files->contains($file)) {
  109.             $this->files[] = $file;
  110.             $file->setFenceElement($this);
  111.         }
  112.         return $this;
  113.     }
  114.     public function removeFile(File $file): self
  115.     {
  116.         if ($this->files->removeElement($file)) {
  117.             // set the owning side to null (unless already changed)
  118.             if ($file->getFenceElement() === $this) {
  119.                 $file->setFenceElement(null);
  120.             }
  121.         }
  122.         return $this;
  123.     }
  124.     /**
  125.      * @return Collection<int, FenceDictionary>
  126.      */
  127.     public function getFences(): Collection
  128.     {
  129.         return $this->fences;
  130.     }
  131.     public function addFence(FenceDictionary $fence): self
  132.     {
  133.         if (!$this->fences->contains($fence)) {
  134.             $this->fences[] = $fence;
  135.         }
  136.         return $this;
  137.     }
  138.     public function removeFence(FenceDictionary $fence): self
  139.     {
  140.         $this->fences->removeElement($fence);
  141.         return $this;
  142.     }
  143.     public function __toString()
  144.     {
  145.         return $this->name;
  146.     }
  147.     public function getPlacementOption(): ?string
  148.     {
  149.         return $this->placementOption;
  150.     }
  151.     public function setPlacementOption(?string $placementOption): self
  152.     {
  153.         $this->placementOption $placementOption;
  154.         return $this;
  155.     }
  156.     public function getPlacementType(): ?string
  157.     {
  158.         return $this->placementType;
  159.     }
  160.     public function setPlacementType(?string $placementType): self
  161.     {
  162.         $this->placementType $placementType;
  163.         return $this;
  164.     }
  165.     public function getPlacementPoint(): ?FenceOfferElement
  166.     {
  167.         return $this->placementPoint;
  168.     }
  169.     public function setPlacementPoint(?FenceOfferElement $placementPoint): self
  170.     {
  171.         $this->placementPoint $placementPoint;
  172.         return $this;
  173.     }
  174.     public function getFormData(): ?array
  175.     {
  176.         return $this->formData;
  177.     }
  178.     public function setFormData(?array $formData): self
  179.     {
  180.         $this->formData $formData;
  181.         return $this;
  182.     }
  183.     public function getType(): ?string
  184.     {
  185.         return $this->type;
  186.     }
  187.     public function setType(?string $type): self
  188.     {
  189.         $this->type $type;
  190.         return $this;
  191.     }
  192.     public function getElementType(): ?string
  193.     {
  194.         return $this->elementType;
  195.     }
  196.     public function setElementType(?string $elementType): self
  197.     {
  198.         $this->elementType $elementType;
  199.         return $this;
  200.     }
  201.     public function getEnglishName(): ?string
  202.     {
  203.         return $this->englishName;
  204.     }
  205.     public function setEnglishName(?string $englishName): self
  206.     {
  207.         $this->englishName $englishName;
  208.         return $this;
  209.     }
  210. }