Eventlistener to create accompanyingPeriodWork

This commit is contained in:
2021-12-06 13:57:10 +00:00
committed by Julien Fastré
parent 9924c3a3b7
commit f10d762e59
5 changed files with 101 additions and 7 deletions

View File

@@ -143,7 +143,7 @@ class ActivityType extends AbstractType
return array_map(
fn (string $id): ?SocialIssue => $this->om->getRepository(SocialIssue::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialIssuesAsString)
explode(',', (string) $socialIssuesAsString)
);
}
));
@@ -169,7 +169,7 @@ class ActivityType extends AbstractType
return array_map(
fn (string $id): ?SocialAction => $this->om->getRepository(SocialAction::class)->findOneBy(['id' => (int) $id]),
explode(',', $socialActionsAsString)
explode(',', (string) $socialActionsAsString)
);
}
));
@@ -262,7 +262,7 @@ class ActivityType extends AbstractType
function (?string $personsAsString): array {
return array_map(
fn (string $id): ?Person => $this->om->getRepository(Person::class)->findOneBy(['id' => (int) $id]),
explode(',', $personsAsString)
explode(',', (string) $personsAsString)
);
}
));
@@ -284,7 +284,7 @@ class ActivityType extends AbstractType
function (?string $thirdpartyAsString): array {
return array_map(
fn (string $id): ?ThirdParty => $this->om->getRepository(ThirdParty::class)->findOneBy(['id' => (int) $id]),
explode(',', $thirdpartyAsString)
explode(',', (string) $thirdpartyAsString)
);
}
));
@@ -317,7 +317,7 @@ class ActivityType extends AbstractType
function (?string $usersAsString): array {
return array_map(
fn (string $id): ?User => $this->om->getRepository(User::class)->findOneBy(['id' => (int) $id]),
explode(',', $usersAsString)
explode(',', (string) $usersAsString)
);
}
));
@@ -332,7 +332,7 @@ class ActivityType extends AbstractType
return '';
}
return $location->getId();
return (string) $location->getId();
},
function (?string $id): ?Location {
return $this->om->getRepository(Location::class)->findOneBy(['id' => (int) $id]);
@@ -379,7 +379,7 @@ class ActivityType extends AbstractType
$timezoneUTC = new DateTimeZone('GMT');
/** @var DateTime $data */
$data = $formEvent->getData() === null ?
DateTime::createFromFormat('U', 300) :
DateTime::createFromFormat('U', '300') :
$formEvent->getData();
$seconds = $data->getTimezone()->getOffset($data);
$data->setTimeZone($timezoneUTC);