mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
move logic of context to different interfaces
This commit is contained in:
@@ -14,6 +14,7 @@ namespace Chill\DocGeneratorBundle\Controller;
|
||||
use Base64Url\Base64Url;
|
||||
use ChampsLibres\AsyncUploaderBundle\TempUrl\TempUrlGeneratorInterface;
|
||||
use Chill\DocGeneratorBundle\Context\ContextManager;
|
||||
use Chill\DocGeneratorBundle\Context\DocGeneratorContextWithPublicFormInterface;
|
||||
use Chill\DocGeneratorBundle\Context\Exception\ContextNotFoundException;
|
||||
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
|
||||
use Chill\DocGeneratorBundle\GeneratorDriver\DriverInterface;
|
||||
@@ -103,7 +104,8 @@ final class DocGeneratorTemplateController extends AbstractController
|
||||
|
||||
$contextGenerationData = [];
|
||||
|
||||
if ($context->hasPublicForm($template, $entity)) {
|
||||
if ($context instanceof DocGeneratorContextWithPublicFormInterface
|
||||
&& $context->hasPublicForm($template, $entity)) {
|
||||
$builder = $this->createFormBuilder();
|
||||
$context->buildPublicForm($builder, $template, $entity);
|
||||
$form = $builder->getForm()->handleRequest($request);
|
||||
|
Reference in New Issue
Block a user