Add context parameter to export generation methods

This commit is contained in:
Julien Fastré 2025-04-24 22:00:13 +02:00
parent 828739edf5
commit a74118e5d4
Signed by: julienfastre
GPG Key ID: BDE2190974723FCB
2 changed files with 5 additions and 2 deletions

View File

@ -112,6 +112,7 @@ final readonly class ExportGenerator
$data['export'], $data['export'],
$filtersData, $filtersData,
$aggregatorsData, $aggregatorsData,
$context,
); );
} }
@ -125,6 +126,7 @@ final readonly class ExportGenerator
$data['export'], $data['export'],
$filtersData, $filtersData,
$aggregatorsData, $aggregatorsData,
$context,
); );
return new FormattedExportGeneration($generatedExport->getContent(), $generatedExport->headers->get('content-type')); return new FormattedExportGeneration($generatedExport->getContent(), $generatedExport->headers->get('content-type'));

View File

@ -15,7 +15,7 @@ use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Contracts\Translation\TranslatableInterface; use Symfony\Contracts\Translation\TranslatableInterface;
/** /**
* @method generate($result, $formatterData, string $exportAlias, array $exportData, array $filtersData, array $aggregatorsData): FormattedExportGeneration * @method generate($result, $formatterData, string $exportAlias, array $exportData, array $filtersData, array $aggregatorsData, ExportGenerationContext $context): FormattedExportGeneration
*/ */
interface FormatterInterface interface FormatterInterface
{ {
@ -51,8 +51,8 @@ interface FormatterInterface
* @param mixed[] $result The result, as given by the ExportInterface * @param mixed[] $result The result, as given by the ExportInterface
* @param mixed[] $formatterData collected from the current form * @param mixed[] $formatterData collected from the current form
* @param string $exportAlias the id of the current export * @param string $exportAlias the id of the current export
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
* @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data * @param array $aggregatorsData an array containing the aggregators data. The key are the filters id, and the value are the data
* @param array $filtersData an array containing the filters data. The key are the filters id, and the value are the data
* *
* @return \Symfony\Component\HttpFoundation\Response The response to be shown * @return \Symfony\Component\HttpFoundation\Response The response to be shown
* *
@ -65,6 +65,7 @@ interface FormatterInterface
array $exportData, array $exportData,
array $filtersData, array $filtersData,
array $aggregatorsData, array $aggregatorsData,
ExportGenerationContext $context,
); );
public function getType(): string; public function getType(): string;