Mostrar reservas
This commit is contained in:
@ -35,7 +35,7 @@ class Persona extends Ideal\Service
|
||||
/**
|
||||
* @param int $rut
|
||||
* @return Model\Persona
|
||||
* @throws Read|Create
|
||||
* @throws Read
|
||||
*/
|
||||
public function getById(int $rut): Model\Persona
|
||||
{
|
||||
@ -44,7 +44,11 @@ class Persona extends Ideal\Service
|
||||
} catch (Implement\Exception\EmptyResult) {
|
||||
try {
|
||||
$this->propietarioRepository->fetchById($rut);
|
||||
return $this->add(compact('rut'));
|
||||
try {
|
||||
return $this->add(compact('rut'));
|
||||
} catch (Create $exception) {
|
||||
throw new Read(__CLASS__, $exception);
|
||||
}
|
||||
} catch (Implement\Exception\EmptyResult $exception) {
|
||||
throw new Read(__CLASS__, $exception);
|
||||
}
|
||||
|
@ -48,6 +48,20 @@ class Promotion extends Ideal\Service
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $project_id
|
||||
* @return array
|
||||
* @throws Exception\ServiceAction\Read
|
||||
*/
|
||||
public function getByProject(int $project_id): array
|
||||
{
|
||||
try {
|
||||
return array_map([$this, 'process'], $this->promotionRepository->fetchByProject($project_id));
|
||||
} catch (Implement\Exception\EmptyResult $exception) {
|
||||
throw new Exception\ServiceAction\Read(__CLASS__, $exception);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $contract_id
|
||||
* @return array
|
||||
|
Reference in New Issue
Block a user