<?phpnamespace App\Entity;use App\Repository\MeasurementsRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: MeasurementsRepository::class)]class Measurements extends BaseEntity{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 255)] private $name; #[ORM\Column(type: 'string', length: 255)] private $measurement; #[ORM\OneToMany(mappedBy: 'measurement', targetEntity: Product::class)] private $products; #[ORM\Column(type: 'float')] private $length; #[ORM\Column(type: 'float')] private $width; #[ORM\Column(type: 'float')] private $thickness; #[ORM\OneToMany(mappedBy: 'measurement', targetEntity: MeasurementConversions::class)] private Collection $conversions; public function __construct() { $this->products = new ArrayCollection(); $this->conversions = new ArrayCollection(); } public function __invoke() { return $this->getId(); } 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 getMeasurement(): ?string { return $this->measurement; } public function setMeasurement(string $measurement): self { $this->measurement = $measurement; return $this; } /** * @return Collection<int, Product> */ public function getProducts(): Collection { return $this->products; } public function addProduct(Product $product): self { if (!$this->products->contains($product)) { $this->products[] = $product; $product->setMeasurement($this); } return $this; } public function removeProduct(Product $product): self { if ($this->products->removeElement($product)) { // set the owning side to null (unless already changed) if ($product->getMeasurement() === $this) { $product->setMeasurement(null); } } return $this; } public function getLength(): ?float { return $this->length; } public function setLength(float $length): self { $this->length = $length; return $this; } public function getWidth(): ?float { return $this->width; } public function setWidth(float $width): self { $this->width = $width; return $this; } public function getThickness(): ?float { return $this->thickness; } public function setThickness(float $thickness): self { $this->thickness = $thickness; return $this; } public function getConversions(): Collection { return $this->conversions; } public function setConversions(Collection $conversions): void { $this->conversions = $conversions; }}