<?phpnamespace App\Entity;use App\Repository\FenceColorDictionaryRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Gedmo\Timestampable\Traits\TimestampableEntity;/** * @ORM\Entity(repositoryClass=FenceColorDictionaryRepository::class) */class FenceColorDictionary{ /** * Hook timestampable behavior * updates createdAt, updatedAt fields */ use TimestampableEntity; /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\OneToMany(targetEntity=FenceDictionary::class, mappedBy="fenceColorDictionary") */ private $fence; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255) */ private $color; /** * @ORM\Column(type="string", length=7) */ private $colorHex; /** * @ORM\Column(type="string", length=255) */ private $type; /** * @ORM\Column(type="boolean") */ private $isIndividualColor; public function __construct() { $this->fence = new ArrayCollection(); } public function getId(): ?int { return $this->id; } /** * @return Collection<int, FenceDictionary> */ public function getFence(): Collection { return $this->fence; } public function addFence(FenceDictionary $fence): self { if (!$this->fence->contains($fence)) { $this->fence[] = $fence; $fence->setFenceColorDictionary($this); } return $this; } public function removeFence(FenceDictionary $fence): self { if ($this->fence->removeElement($fence)) { // set the owning side to null (unless already changed) if ($fence->getFenceColorDictionary() === $this) { $fence->setFenceColorDictionary(null); } } return $this; } public function __toString() { return $this->name; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getColor(): ?string { return $this->color; } public function setColor(string $color): self { $this->color = $color; return $this; } public function getColorHex(): ?string { return $this->colorHex; } public function setColorHex(string $colorHex): self { $this->colorHex = $colorHex; return $this; } public function getType(): ?string { return $this->type; } public function setType(string $type): self { $this->type = $type; return $this; } public function getIsIndividualColor(): ?bool { return $this->isIndividualColor; } public function setIsIndividualColor(bool $isIndividualColor): self { $this->isIndividualColor = $isIndividualColor; return $this; }}