code = $code; $this->name = $name; $this->quantity = $quantity; $this->price = $price; } /** * @return string */ public function getCode(): ?string { return $this->code; } /** * @return string */ public function getName(): ?string { return $this->name; } /** * @return int */ public function getQuantity(): ?int { return $this->quantity; } /** * @return float */ public function getPrice(): ?float { return $this->price; } public function getAmount(): float { return $this->getQuantity() * $this->getPrice(); } }