mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-22 07:33:50 +00:00
move logic of context to different interfaces
This commit is contained in:
@@ -13,26 +13,12 @@ namespace Chill\DocGeneratorBundle\Context;
|
||||
|
||||
use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
|
||||
use Chill\DocStoreBundle\Entity\StoredObject;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
/**
|
||||
* Interface for context for document generation.
|
||||
*/
|
||||
interface DocGeneratorContextInterface
|
||||
{
|
||||
public function adminFormReverseTransform(array $data): array;
|
||||
|
||||
public function adminFormTransform(array $data): array;
|
||||
|
||||
public function buildAdminForm(FormBuilderInterface $builder): void;
|
||||
|
||||
/**
|
||||
* Generate the form that display.
|
||||
*
|
||||
* @param mixed $entity
|
||||
*/
|
||||
public function buildPublicForm(FormBuilderInterface $builder, DocGeneratorTemplate $template, $entity): void;
|
||||
|
||||
/**
|
||||
* Get the data that will be injected to the generated document.
|
||||
*
|
||||
@@ -48,14 +34,5 @@ interface DocGeneratorContextInterface
|
||||
|
||||
public function getName(): string;
|
||||
|
||||
public function hasAdminForm(): bool;
|
||||
|
||||
/**
|
||||
* has form.
|
||||
*
|
||||
* @param mixed $entity
|
||||
*/
|
||||
public function hasPublicForm(DocGeneratorTemplate $template, $entity): bool;
|
||||
|
||||
public function storeGenerated(DocGeneratorTemplate $template, StoredObject $storedObject, object $entity, array $contextGenerationData): void;
|
||||
}
|
||||
|
Reference in New Issue
Block a user