mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
[edit export] add required method on export's interface
The method "getFormDefaultData" is applyied on every interface which will use it: - ExportInterface - AggregatorInterface - DirectExportInterface - FilterInterface The method buildForm is moved to those interfaces. [ci-skip]
This commit is contained in:
parent
d5ee158caa
commit
ea77adc640
@ -12,6 +12,7 @@ declare(strict_types=1);
|
||||
namespace Chill\MainBundle\Export;
|
||||
|
||||
use Closure;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
/**
|
||||
* Interface for Aggregators.
|
||||
@ -21,6 +22,16 @@ use Closure;
|
||||
*/
|
||||
interface AggregatorInterface extends ModifierInterface
|
||||
{
|
||||
/**
|
||||
* Add a form to collect data from the user.
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder);
|
||||
|
||||
/**
|
||||
* Get the default data, that can be use as "data" for the form
|
||||
*/
|
||||
public function getFormDefaultData(): array;
|
||||
|
||||
/**
|
||||
* get a callable which will be able to transform the results into
|
||||
* viewable and understable string.
|
||||
|
@ -11,10 +11,21 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Export;
|
||||
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
interface DirectExportInterface extends ExportElementInterface
|
||||
{
|
||||
/**
|
||||
* Add a form to collect data from the user.
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder);
|
||||
|
||||
/**
|
||||
* Get the default data, that can be use as "data" for the form
|
||||
*/
|
||||
public function getFormDefaultData(): array;
|
||||
|
||||
/**
|
||||
* Generate the export.
|
||||
*/
|
||||
|
@ -19,10 +19,6 @@ use Symfony\Component\Form\FormBuilderInterface;
|
||||
*/
|
||||
interface ExportElementInterface
|
||||
{
|
||||
/**
|
||||
* Add a form to collect data from the user.
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder);
|
||||
|
||||
/**
|
||||
* get a title, which will be used in UI (and translated).
|
||||
|
@ -13,6 +13,7 @@ namespace Chill\MainBundle\Export;
|
||||
|
||||
use Doctrine\ORM\NativeQuery;
|
||||
use Doctrine\ORM\QueryBuilder;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
/**
|
||||
* Interface for Export.
|
||||
@ -28,6 +29,16 @@ use Doctrine\ORM\QueryBuilder;
|
||||
*/
|
||||
interface ExportInterface extends ExportElementInterface
|
||||
{
|
||||
/**
|
||||
* Add a form to collect data from the user.
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder);
|
||||
|
||||
/**
|
||||
* Get the default data, that can be use as "data" for the form
|
||||
*/
|
||||
public function getFormDefaultData(): array;
|
||||
|
||||
/**
|
||||
* Return which formatter type is allowed for this report.
|
||||
*
|
||||
|
@ -11,6 +11,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Export;
|
||||
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
|
||||
/**
|
||||
* Interface for filters.
|
||||
*
|
||||
@ -23,6 +25,16 @@ interface FilterInterface extends ModifierInterface
|
||||
{
|
||||
public const STRING_FORMAT = 'string';
|
||||
|
||||
/**
|
||||
* Add a form to collect data from the user.
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder);
|
||||
|
||||
/**
|
||||
* Get the default data, that can be use as "data" for the form
|
||||
*/
|
||||
public function getFormDefaultData(): array;
|
||||
|
||||
/**
|
||||
* Describe the filtering action.
|
||||
*
|
||||
|
@ -34,6 +34,11 @@ interface FormatterInterface
|
||||
array $aggregatorAliases
|
||||
);
|
||||
|
||||
/**
|
||||
* get the default data for the form build by buildForm
|
||||
*/
|
||||
public function getFormDefaultData(array $aggregatorAliases): array;
|
||||
|
||||
public function getName();
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user