public function cancel() { if ($this->isCanceled()) { throw new LogicException('QTY reserve is already canceled.'); } if (!$this->isPlaced()) { return false; } try { $this->performAction(self::ACTION_ADD, self::STATE_CANCELED); $this->order->addSuccessLog('QTY reserve has been canceled.'); } catch (Exception $e) { $this->order->addErrorLog('QTY reserve was not canceled. Reason: %msg%', array('msg' => $e->getMessage())); return false; } return true; }