Set requestor for accompanying period

This commit is contained in:
2021-05-10 15:59:34 +02:00
parent 3447117742
commit 4f3f16d9b0
10 changed files with 193 additions and 19 deletions

View File

@@ -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;