mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Set requestor for accompanying period
This commit is contained in:
@@ -83,16 +83,16 @@ class PersonNormalizer implements
|
||||
public function denormalize($data, string $type, string $format = null, array $context = []): Person
|
||||
{
|
||||
if ($context[self::GET_PERSON] ?? true) {
|
||||
$id = $data['id'] ?? null;
|
||||
$id = $data['person_id'] ?? null;
|
||||
if (NULL === $id) {
|
||||
throw new RuntimeException("missing id into person object");
|
||||
throw new RuntimeException("missing person_id into person object");
|
||||
}
|
||||
}
|
||||
/** var Person $person */
|
||||
$person = $this->repository->findOneById($id);
|
||||
|
||||
if (NULL === $person) {
|
||||
return UnexpectedValueException("person id not found");
|
||||
throw new UnexpectedValueException("person id not found");
|
||||
}
|
||||
|
||||
return $person;
|
||||
|
Reference in New Issue
Block a user