<?php
namespace App\Entity;
use App\Repository\FenceElementDictionaryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* @ORM\Entity(repositoryClass=FenceElementDictionaryRepository::class)
*/
class FenceElementDictionary
{
/**
* Hook timestampable behavior
* updates createdAt, updatedAt fields
*/
use TimestampableEntity;
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="json")
*/
private $formConfigJson = [];
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $alfenValue;
/**
* @ORM\OneToMany(targetEntity=File::class, mappedBy="fenceElement")
*/
private $files;
/**
* @ORM\ManyToMany(targetEntity=FenceDictionary::class, inversedBy="fenceElementDictionaries")
*/
private $fences;
private $placementOption;
private $placementType;
private $placementPoint;
/**
* @var array|null
*/
private $formData;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $type;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $elementType;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $englishName;
public function __construct()
{
$this->files = new ArrayCollection();
$this->fences = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getFormConfigJson(): ?array
{
return $this->formConfigJson;
}
public function setFormConfigJson(array $formConfigJson): self
{
$this->formConfigJson = $formConfigJson;
return $this;
}
public function getAlfenValue(): ?string
{
return $this->alfenValue;
}
public function setAlfenValue(string $alfenValue): self
{
$this->alfenValue = $alfenValue;
return $this;
}
/**
* @return Collection<int, File>
*/
public function getFiles(): Collection
{
return $this->files;
}
public function addFile(File $file): self
{
if (!$this->files->contains($file)) {
$this->files[] = $file;
$file->setFenceElement($this);
}
return $this;
}
public function removeFile(File $file): self
{
if ($this->files->removeElement($file)) {
// set the owning side to null (unless already changed)
if ($file->getFenceElement() === $this) {
$file->setFenceElement(null);
}
}
return $this;
}
/**
* @return Collection<int, FenceDictionary>
*/
public function getFences(): Collection
{
return $this->fences;
}
public function addFence(FenceDictionary $fence): self
{
if (!$this->fences->contains($fence)) {
$this->fences[] = $fence;
}
return $this;
}
public function removeFence(FenceDictionary $fence): self
{
$this->fences->removeElement($fence);
return $this;
}
public function __toString()
{
return $this->name;
}
public function getPlacementOption(): ?string
{
return $this->placementOption;
}
public function setPlacementOption(?string $placementOption): self
{
$this->placementOption = $placementOption;
return $this;
}
public function getPlacementType(): ?string
{
return $this->placementType;
}
public function setPlacementType(?string $placementType): self
{
$this->placementType = $placementType;
return $this;
}
public function getPlacementPoint(): ?FenceOfferElement
{
return $this->placementPoint;
}
public function setPlacementPoint(?FenceOfferElement $placementPoint): self
{
$this->placementPoint = $placementPoint;
return $this;
}
public function getFormData(): ?array
{
return $this->formData;
}
public function setFormData(?array $formData): self
{
$this->formData = $formData;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
public function getElementType(): ?string
{
return $this->elementType;
}
public function setElementType(?string $elementType): self
{
$this->elementType = $elementType;
return $this;
}
public function getEnglishName(): ?string
{
return $this->englishName;
}
public function setEnglishName(?string $englishName): self
{
$this->englishName = $englishName;
return $this;
}
}