deleted = 0; } public function setDefault(TransactionProductInterface $_product, $_quantity=1){ $this->product = $_product; $this->quantity = $_quantity; $this->calculTotal(); } private function calculTotal(){ $this->totalBasketLine = ($this->product->getPrice() * $this->quantity); } public function getId(): ?int { return $this->id; } public function getProduct(): ?TransactionProductInterface { return $this->product; } public function getQuantity(): ?int { return $this->quantity; } public function setQuantity(?int $quantity): BasketLineInterface { $this->quantity = $quantity; $this->calculTotal(); return $this; } public function getDeleted(): ?bool { return $this->deleted; } public function setDeleted(?bool $deleted): BasketLineInterface { $this->deleted = $deleted; return $this; } public function getTransaction(): ?TransactionInterface { return $this->transaction; } public function setTransaction(?TransactionInterface $transaction): BasketLineInterface { $this->transaction = $transaction; return $this; } /** * @param float|null $totalBasketLine * @return BasketLineInterface */ public function setTotalBasketLine(?float $totalBasketLine): BasketLineInterface { $this->totalBasketLine = $totalBasketLine; return $this; } /** * @return float|null */ public function getTotalBasketLine(): ?float { return $this->totalBasketLine; } public function setProduct(?TransactionProduct $product): self { $this->product = $product; return $this; } }