normalization for docgen:read: add groups and so on (wip)

This commit is contained in:
2021-12-06 13:18:59 +01:00
parent 51fd81c661
commit c4998f4ac1
15 changed files with 166 additions and 70 deletions

View File

@@ -90,11 +90,6 @@ final class DocGeneratorTemplateController extends AbstractController
int $entityId,
Request $request
): Response {
$entity = $this->getDoctrine()->getRepository($entityClassName)->find($entityId);
if (null === $entity) {
throw new NotFoundHttpException("Entity with classname {$entityClassName} and id {$entityId} is not found");
}
try {
$context = $this->contextManager->getContextByDocGeneratorTemplate($template);
@@ -102,6 +97,12 @@ final class DocGeneratorTemplateController extends AbstractController
throw new NotFoundHttpException($e->getMessage(), $e);
}
$entity = $this->getDoctrine()->getRepository($context->getEntityClass())->find($entityId);
if (null === $entity) {
throw new NotFoundHttpException("Entity with classname {$entityClassName} and id {$entityId} is not found");
}
$contextGenerationData = [];
if ($context instanceof DocGeneratorContextWithPublicFormInterface