<?phpnamespace App\Entity;use App\Entity\AbstractOption;use Doctrine\ORM\Mapping as ORM;use App\Entity\Trait\TranslatableLocale;use Doctrine\Common\Collections\Collection;use App\Repository\OptionQuantityRepository;use Doctrine\Common\Collections\ArrayCollection;/** * @ORM\Entity(repositoryClass=OptionQuantityRepository::class) */class OptionQuantity extends AbstractOption{ use TranslatableLocale; /** * @ORM\Column(type="integer") */ private $price; /** * @ORM\ManyToOne(targetEntity=Extra::class, inversedBy="optionQuantities") * @ORM\JoinColumn(nullable=false) */ private $extra; /** * @ORM\OneToMany(targetEntity=OptionQuantityReservation::class, mappedBy="optionQuantity") */ private $optionQuantityReservations; /** * @ORM\Column(type="float", nullable=true) */ private $tvaRatio; public function __construct() { $this->optionQuantityReservations = new ArrayCollection(); } public function getPrice(): ?float { return $this->price / 100; } public function setPrice(int $price): self { $this->price = $price; return $this; } public function getExtra(): ?Extra { return $this->extra; } public function setExtra(?Extra $extra): self { $this->extra = $extra; return $this; } /** * @return Collection<int, OptionQuantityReservation> */ public function getOptionQuantityReservations(): Collection { return $this->optionQuantityReservations; } public function addOptionQuantityReservation(OptionQuantityReservation $optionQuantityReservation): self { if (!$this->optionQuantityReservations->contains($optionQuantityReservation)) { $this->optionQuantityReservations[] = $optionQuantityReservation; $optionQuantityReservation->setOptionQuantity($this); } return $this; } public function removeOptionQuantityReservation(OptionQuantityReservation $optionQuantityReservation): self { if ($this->optionQuantityReservations->removeElement($optionQuantityReservation)) { // set the owning side to null (unless already changed) if ($optionQuantityReservation->getOptionQuantity() === $this) { $optionQuantityReservation->setOptionQuantity(null); } } return $this; } public function getTvaRatio(): ?float { return $this->tvaRatio; } public function setTvaRatio(?float $tvaRatio): self { $this->tvaRatio = $tvaRatio; return $this; }}