Cleanup
This commit is contained in:
@ -2,6 +2,7 @@
|
||||
namespace Incoviba\Service\Venta;
|
||||
|
||||
use Incoviba\Common\Implement\Exception\EmptyResult;
|
||||
use Incoviba\Exception\ServiceAction\Read;
|
||||
use Incoviba\Repository;
|
||||
use Incoviba\Model;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@ -27,8 +28,18 @@ class BonoPie
|
||||
}
|
||||
return $bono;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $venta_id
|
||||
* @return Model\Venta\BonoPie
|
||||
* @throws Read
|
||||
*/
|
||||
public function getByVenta(int $venta_id): Model\Venta\BonoPie
|
||||
{
|
||||
return $this->bonoPieRepository->fetchByVenta($venta_id);
|
||||
try {
|
||||
return $this->bonoPieRepository->fetchByVenta($venta_id);
|
||||
} catch (EmptyResult $exception) {
|
||||
throw new Read(__CLASS__, $exception);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user