mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 00:23:50 +00:00
change id, to avoid collision between ListPersonHelper and ListAccompanyingPeriodHelper
This commit is contained in:
@@ -32,7 +32,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
final readonly class ListAccompanyingPeriodHelper
|
||||
{
|
||||
public const FIELDS = [
|
||||
'id',
|
||||
'acpId',
|
||||
'step',
|
||||
'stepSince',
|
||||
'openingDate',
|
||||
@@ -219,8 +219,10 @@ final readonly class ListAccompanyingPeriodHelper
|
||||
|
||||
public function addSelectClauses(QueryBuilder $qb, \DateTimeImmutable $calcDate): void
|
||||
{
|
||||
$qb->addSelect('acp.id AS acpId');
|
||||
|
||||
// add the regular fields
|
||||
foreach (['id', 'openingDate', 'closingDate', 'confidential', 'emergency', 'intensity', 'createdAt', 'updatedAt'] as $field) {
|
||||
foreach (['openingDate', 'closingDate', 'confidential', 'emergency', 'intensity', 'createdAt', 'updatedAt'] as $field) {
|
||||
$qb->addSelect(sprintf('acp.%s AS %s', $field, $field));
|
||||
}
|
||||
|
||||
|
@@ -42,7 +42,7 @@ use function strlen;
|
||||
class ListPersonHelper
|
||||
{
|
||||
public const FIELDS = [
|
||||
'id',
|
||||
'personId',
|
||||
'civility',
|
||||
'firstName',
|
||||
'lastName',
|
||||
@@ -124,6 +124,11 @@ class ListPersonHelper
|
||||
}
|
||||
|
||||
switch ($f) {
|
||||
case 'personId':
|
||||
$qb->addSelect('person.id AS personId');
|
||||
|
||||
break;
|
||||
|
||||
case 'countryOfBirth':
|
||||
case 'nationality':
|
||||
$qb->addSelect(sprintf('IDENTITY(person.%s) as %s', $f, $f));
|
||||
|
Reference in New Issue
Block a user