findOneById($product_id); if(!$product) { throw new Exception('Snažím se vložit neexistující produkt.'); } $this->setProductId($product_id); $this->setCode($product->getCode()); $this->setName($product->getName()); $this->setPrice($product->getPrice()); } public function getPriceAll() { if($this->getIsGratis()) { return 0; } return $this->getPrice() * $this->getAmount(); } }