mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-25 09:03:48 +00:00
Partage d'export enregistré et génération asynchrone des exports
This commit is contained in:
@@ -36,7 +36,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
||||
return null;
|
||||
}
|
||||
|
||||
public function alterQuery(QueryBuilder $qb, $data)
|
||||
public function alterQuery(QueryBuilder $qb, $data, \Chill\MainBundle\Export\ExportGenerationContext $exportGenerationContext): void
|
||||
{
|
||||
// add select element
|
||||
if ('reasons' === $data['level']) {
|
||||
@@ -72,7 +72,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
||||
return Declarations::ACTIVITY;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder)
|
||||
public function buildForm(FormBuilderInterface $builder): void
|
||||
{
|
||||
$builder->add(
|
||||
'level',
|
||||
@@ -89,6 +89,21 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
||||
);
|
||||
}
|
||||
|
||||
public function getNormalizationVersion(): int
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function normalizeFormData(array $formData): array
|
||||
{
|
||||
return ['level' => $formData['level']];
|
||||
}
|
||||
|
||||
public function denormalizeFormData(array $formData, int $fromVersion): array
|
||||
{
|
||||
return ['level' => $formData['level']];
|
||||
}
|
||||
|
||||
public function getFormDefaultData(): array
|
||||
{
|
||||
return [
|
||||
@@ -96,7 +111,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
||||
];
|
||||
}
|
||||
|
||||
public function getLabels($key, array $values, $data)
|
||||
public function getLabels($key, array $values, $data): callable
|
||||
{
|
||||
return function ($value) use ($data) {
|
||||
if ('_header' === $value) {
|
||||
@@ -125,7 +140,7 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
||||
};
|
||||
}
|
||||
|
||||
public function getQueryKeys($data)
|
||||
public function getQueryKeys($data): array
|
||||
{
|
||||
// add select element
|
||||
if ('reasons' === $data['level']) {
|
||||
@@ -139,12 +154,12 @@ class ActivityReasonAggregator implements AggregatorInterface, ExportElementVali
|
||||
throw new \RuntimeException('The data provided are not recognised.');
|
||||
}
|
||||
|
||||
public function getTitle()
|
||||
public function getTitle(): string|\Symfony\Contracts\Translation\TranslatableInterface
|
||||
{
|
||||
return 'Aggregate by activity reason';
|
||||
}
|
||||
|
||||
public function validateForm($data, ExecutionContextInterface $context)
|
||||
public function validateForm($data, ExecutionContextInterface $context): void
|
||||
{
|
||||
if (null === $data['level']) {
|
||||
$context
|
||||
|
Reference in New Issue
Block a user