/** * @param int $idRefund * * @throws \Pav\Zed\Refund\Business\Exception\RefundNotFoundException * @return \Generated\Shared\Transfer\RefundTransfer */ public function getRefund($idRefund) { $refundEntity = $this->queryContainer->queryRefundById($idRefund)->findOne(); if ($refundEntity === null) { throw new RefundNotFoundException(sprintf('Refund entity id: %s not found', $idRefund)); } $refundTransfer = $this->convertToTransfer($refundEntity); $refundTransfer = $this->totalsAggregator->aggregate($refundTransfer); return $refundTransfer; }
/** * @param int $idRefund * * @throws \Pav\Zed\Refund\Business\Exception\RefundNotFoundException * @return \Orm\Zed\Refund\Persistence\PavRefund */ protected function getRefundEntity($idRefund) { $refundEntity = $this->queryContainer->queryRefundById($idRefund)->findOne(); if ($refundEntity === null) { throw new RefundNotFoundException(sprintf('Refund %s not found', $idRefund)); } return $refundEntity; }