src/Entity/LookUpTableDimension.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\LookUpTableDimensionRepository;
  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. #[ORM\Entity(repositoryClassLookUpTableDimensionRepository::class)]
  9. class LookUpTableDimension
  10. {
  11.     use TimestampableEntity;
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id null;
  16.     #[ORM\Column(length255nullabletrue)]
  17.     private ?string $name null;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     private ?string $field null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $type null;
  22.     #[ORM\Column(length255nullabletrue)]
  23.     private ?string $dataType null;
  24.     #[ORM\Column]
  25.     private ?int $orderNumber 0;
  26.     #[ORM\ManyToOne(inversedBy'lookUpTableDimensions'fetch:'EAGER')]
  27.     private ?LookUpTable $lookUpTable null;
  28.     #[ORM\OneToMany(mappedBy'lookUpTableDimension'targetEntityLookUpTableDataValue::class)]
  29.     private Collection $lookUpTableDataValues;
  30.     public function __construct()
  31.     {
  32.         $this->lookUpTableDataValues = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getName(): ?string
  39.     {
  40.         return $this->name;
  41.     }
  42.     public function setName(?string $name): static
  43.     {
  44.         $this->name $name;
  45.         return $this;
  46.     }
  47.     public function getField(): ?string
  48.     {
  49.         return $this->field;
  50.     }
  51.     public function setField(?string $field): static
  52.     {
  53.         $this->field $field;
  54.         return $this;
  55.     }
  56.     public function getType(): ?string
  57.     {
  58.         return $this->type;
  59.     }
  60.     public function setType(?string $type): static
  61.     {
  62.         $this->type $type;
  63.         return $this;
  64.     }
  65.     public function getDataType(): ?string
  66.     {
  67.         return $this->dataType;
  68.     }
  69.     public function setDataType(?string $dataType): static
  70.     {
  71.         $this->dataType $dataType;
  72.         return $this;
  73.     }
  74.     public function getOrderNumber(): ?int
  75.     {
  76.         return $this->orderNumber;
  77.     }
  78.     public function setOrderNumber(int $orderNumber): static
  79.     {
  80.         $this->orderNumber $orderNumber;
  81.         return $this;
  82.     }
  83.     public function getLookUpTable(): ?LookUpTable
  84.     {
  85.         return $this->lookUpTable;
  86.     }
  87.     public function setLookUpTable(?LookUpTable $lookUpTable): static
  88.     {
  89.         $this->lookUpTable $lookUpTable;
  90.         return $this;
  91.     }
  92.     /**
  93.      * @return Collection<int, LookUpTableDataValue>
  94.      */
  95.     public function getLookUpTableDataValues(): Collection
  96.     {
  97.         return $this->lookUpTableDataValues;
  98.     }
  99.     public function addLookUpTableDataValue(LookUpTableDataValue $lookUpTableDataValue): static
  100.     {
  101.         if (!$this->lookUpTableDataValues->contains($lookUpTableDataValue)) {
  102.             $this->lookUpTableDataValues->add($lookUpTableDataValue);
  103.             $lookUpTableDataValue->setLookUpTableDimension($this);
  104.         }
  105.         return $this;
  106.     }
  107.     public function removeLookUpTableDataValue(LookUpTableDataValue $lookUpTableDataValue): static
  108.     {
  109.         if ($this->lookUpTableDataValues->removeElement($lookUpTableDataValue)) {
  110.             // set the owning side to null (unless already changed)
  111.             if ($lookUpTableDataValue->getLookUpTableDimension() === $this) {
  112.                 $lookUpTableDataValue->setLookUpTableDimension(null);
  113.             }
  114.         }
  115.         return $this;
  116.     }
  117.     public function __toString() {
  118.         return $this->name;
  119.     }
  120. }