mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 22:04:23 +00:00
(to rebase/fixup later) Let Result be associated to a SocialAction.
This commit is contained in:
parent
18d0ad67d6
commit
3b5ef53b9b
@ -160,7 +160,7 @@ final class SocialWorkMetadata implements SocialWorkMetadataInterface
|
||||
return $goal;
|
||||
}
|
||||
|
||||
private function handleResult(?string $resultTitle = null, SocialAction $socialAction, ?Goal $goal = null): ?Result
|
||||
private function handleResult(?string $resultTitle = null, ?SocialAction $socialAction = null, ?Goal $goal = null): ?Result
|
||||
{
|
||||
if (null === $resultTitle) {
|
||||
return null;
|
||||
@ -172,12 +172,15 @@ final class SocialWorkMetadata implements SocialWorkMetadataInterface
|
||||
|
||||
if (null !== $goal) {
|
||||
$result->addGoal($goal);
|
||||
} else {
|
||||
$result->addSocialAction($socialAction);
|
||||
}
|
||||
|
||||
// Why this cannot be found from the Goal entity?
|
||||
$result->addSocialAction($socialAction);
|
||||
$socialAction->addResult($result);
|
||||
|
||||
$this->entityManager->persist($result);
|
||||
$this->entityManager->persist($socialAction);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user