key && 'json' === $format; } public function normalize(GenericDocDTO $genericDocDTO, string $format, array $context = []): array { if (null === $personDocument = $this->personDocumentRepository->find($genericDocDTO->identifiers['id'])) { return ['title' => $this->translator->trans('generic_doc.document removed'), 'isPresent' => false]; } return [ 'isPresent' => true, 'title' => $personDocument->getTitle(), 'html' => $this->twig->render( $this->renderer->getTemplate($genericDocDTO, ['show-actions' => false, 'row-only' => true]), $this->renderer->getTemplateData($genericDocDTO, ['show-actions' => false, 'row-only' => true]) ), ]; } }