Update initiateQuery method to include ExportGenerationContext

The `initiateQuery` method now consistently incorporates the `ExportGenerationContext` parameter across various export classes, improving functionality and standardization. This change ensures compatibility and alignment with the expected method signature.
This commit is contained in:
2025-04-07 11:29:04 +02:00
parent aebeca1d7a
commit bb42ee25ff
50 changed files with 62 additions and 107 deletions

View File

@@ -100,7 +100,7 @@ class AvgDurationAPWorkPersonAssociatedOnAccompanyingPeriod implements ExportInt
return Declarations::SOCIAL_WORK_ACTION_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): \Doctrine\ORM\QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -100,7 +100,7 @@ class AvgDurationAPWorkPersonAssociatedOnWork implements ExportInterface, Groupe
return Declarations::SOCIAL_WORK_ACTION_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): \Doctrine\ORM\QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -112,7 +112,7 @@ class CountAccompanyingCourse implements ExportInterface, GroupedExportInterface
return Declarations::ACP_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -108,7 +108,7 @@ class CountAccompanyingCourseStepHistory implements ExportInterface, GroupedExpo
return Declarations::ACP_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -108,7 +108,7 @@ class CountAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeriod implements
return Declarations::SOCIAL_WORK_ACTION_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -108,7 +108,7 @@ class CountAccompanyingPeriodWorkAssociatePersonOnWork implements ExportInterfac
return Declarations::SOCIAL_WORK_ACTION_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -104,7 +104,7 @@ class CountEvaluation implements ExportInterface, GroupedExportInterface
return Declarations::EVAL_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): \Doctrine\ORM\QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -123,7 +123,7 @@ class CountHouseholdInPeriod implements ExportInterface, GroupedExportInterface
return Declarations::HOUSEHOLD_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): \Doctrine\ORM\QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -108,10 +108,8 @@ class CountPerson implements ExportInterface, GroupedExportInterface
/**
* Initiate the query.
*
* @return QueryBuilder
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -108,7 +108,7 @@ class CountPersonOnAccompanyingPeriodWorkAssociatePersonOnWork implements Export
return Declarations::SOCIAL_WORK_ACTION_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -110,7 +110,7 @@ class CountPersonWithAccompanyingCourse implements ExportInterface, GroupedExpor
return Declarations::HOUSEHOLD_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): \Doctrine\ORM\QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -94,7 +94,7 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp
return $this->listAccompanyingPeriodHelper->getQueryKeys($data);
}
public function getResult($query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context)
public function getResult($query, $data, ExportGenerationContext $context)
{
return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR);
}
@@ -109,7 +109,7 @@ final readonly class ListAccompanyingPeriod implements ListInterface, GroupedExp
return Declarations::PERSON_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [], ExportGenerationContext $context)
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context): \Doctrine\ORM\QueryBuilder
{
$qb = $this->entityManager->createQueryBuilder();

View File

@@ -198,7 +198,7 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeri
return self::FIELDS;
}
public function getResult($query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context)
public function getResult($query, $data, ExportGenerationContext $context)
{
return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR);
}
@@ -213,7 +213,7 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnAccompanyingPeri
return Declarations::SOCIAL_WORK_ACTION_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context)
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
$calcDate = $data['calc_date'] ?? new RollingDate(RollingDate::T_TODAY);

View File

@@ -198,7 +198,7 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements
return self::FIELDS;
}
public function getResult($query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context)
public function getResult($query, $data, ExportGenerationContext $context)
{
return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR);
}
@@ -213,7 +213,7 @@ final readonly class ListAccompanyingPeriodWorkAssociatePersonOnWork implements
return Declarations::SOCIAL_WORK_ACTION_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context)
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
$calcDate = $data['calc_date'] ?? new RollingDate(RollingDate::T_TODAY);

View File

@@ -186,7 +186,7 @@ final readonly class ListEvaluation implements ListInterface, GroupedExportInter
return self::FIELDS;
}
public function getResult($query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context)
public function getResult($query, $data, ExportGenerationContext $context)
{
return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR);
}
@@ -201,7 +201,7 @@ final readonly class ListEvaluation implements ListInterface, GroupedExportInter
return Declarations::EVAL_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context)
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);
$calcDate = $data['calc_date'] ?? new RollingDate(RollingDate::T_TODAY);

View File

@@ -144,7 +144,7 @@ class ListHouseholdInPeriod implements ListInterface, GroupedExportInterface
return Declarations::HOUSEHOLD_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -131,7 +131,7 @@ class ListPerson implements ListInterface, GroupedExportInterface
/**
* param array{fields: string[], address_date: DateTimeImmutable} $data.
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): \Doctrine\ORM\QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -119,7 +119,7 @@ final readonly class ListPersonHavingAccompanyingPeriod implements ListInterface
/**
* param array{fields: string[], address_date: DateTimeImmutable} $data.
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data = [])
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): \Doctrine\ORM\QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -104,7 +104,7 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte
);
}
public function getResult($query, $data, \Chill\MainBundle\Export\ExportGenerationContext $context)
public function getResult($query, $data, ExportGenerationContext $context)
{
return $query->getQuery()->getResult(AbstractQuery::HYDRATE_SCALAR);
}
@@ -122,7 +122,7 @@ final readonly class ListPersonWithAccompanyingPeriodDetails implements ListInte
/**
* param array{fields: string[], address_date: DateTimeImmutable} $data.
*/
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context)
public function initiateQuery(array $requiredModifiers, array $acl, array $data, ExportGenerationContext $context): \Doctrine\ORM\QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);

View File

@@ -127,7 +127,7 @@ final readonly class StatAccompanyingCourseDuration implements ExportInterface,
return Declarations::ACP_TYPE;
}
public function initiateQuery(array $requiredModifiers, array $acl, array $data = []): QueryBuilder
public function initiateQuery(array $requiredModifiers, array $acl, array $data, \Chill\MainBundle\Export\ExportGenerationContext $context): QueryBuilder
{
$centers = array_map(static fn ($el) => $el['center'], $acl);