Cleanup
This commit is contained in:
@ -3,6 +3,7 @@ namespace Incoviba\Service;
|
||||
|
||||
use Incoviba\Common\Ideal;
|
||||
use Incoviba\Common\Implement;
|
||||
use Incoviba\Exception\ServiceAction\Read;
|
||||
use Incoviba\Model;
|
||||
use Incoviba\Repository;
|
||||
use Psr\Log\LoggerInterface;
|
||||
@ -17,9 +18,18 @@ class Persona extends Ideal\Service
|
||||
parent::__construct($logger);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $rut
|
||||
* @return Model\Persona
|
||||
* @throws Read
|
||||
*/
|
||||
public function getById(int $rut): Model\Persona
|
||||
{
|
||||
return $this->process($this->personaRepository->fetchById($rut));
|
||||
try {
|
||||
return $this->process($this->personaRepository->fetchById($rut));
|
||||
} catch (Implement\Exception\EmptyResult $exception) {
|
||||
throw new Read(__CLASS__, $exception);
|
||||
}
|
||||
}
|
||||
public function add(array $data): Model\Persona
|
||||
{
|
||||
|
Reference in New Issue
Block a user