orderProducts = new ArrayCollection() ; } public function getPriceInherited() { if($this->getPrice()) { return $this->getPrice(); } else { return $this->getProductFamily()->getPrice(); } } public function getPriceByRefUnitInherited() { if($this->getPriceByRefUnit()) { return $this->getPriceByRefUnit(); } else { return $this->getProductFamily()->getPriceByRefUnit(); } } public function getBehaviorPriceInherited() { return $this->getProductFamily()->getBehaviorPrice() ; } public function getReductionCatalogInherited() { return $this->getProductFamily()->getReductionCatalog() ; } public function getUnitInherited() { if($this->getUnit()) { return $this->getUnit(); } else { return $this->getProductFamily()->getUnit(); } } public function getTitleInherited() { if($this->getTitle()){ return $this->getTitle(); } else{ return $this->getProductFamily()->getTitle(); } } public function getQuantityInherited() { if($this->getQuantity()) { return $this->getQuantity(); } else{ return $this->getProductFamily()->getQuantity(); } } public function getQuantityLabelInherited() { $quantity = $this->getQuantityInherited() ; $unit = $this->getUnitInherited() ; return $quantity.$unit->getWordingShort() ; } public function getAvailableQuantityInherited() { if($this->getProductFamily()->getBehaviorCountStock()) { return $this->getAvailableQuantity(); } else { return $this->getProductFamily()->getAvailableQuantity(); } } public function getTaxRateInherited() { return $this->getProductFamily()->getTaxRateInherited(); } public function getProductFamily(): ?ProductFamily { return $this->productFamily; } public function setProductFamily(?ProductFamily $productFamily): self { $this->productFamily = $productFamily; return $this; } public function getTitle(): ?string { return $this->title; } public function setTitle(?string $title): self { $this->title = $title; return $this; } /** * @return Collection|OrderProductInterface[] */ public function getOrderProducts(): Collection { return $this->orderProducts; } public function addOrderProduct(OrderProductInterface $orderProduct): self { if (!$this->orderProducts->contains($orderProduct)) { $this->orderProducts[] = $orderProduct; $orderProduct->setProduct($this); } return $this; } public function removeOrderProduct(OrderProductInterface $orderProduct): self { if ($this->orderProducts->contains($orderProduct)) { $this->orderProducts->removeElement($orderProduct); // set the owning side to null (unless already changed) if ($orderProduct->getProduct() === $this) { $orderProduct->setProduct(null); } } return $this; } }