mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
person: fix accompanying period validation
This commit is contained in:
parent
2e4356c3c9
commit
74682549c8
@ -39,24 +39,20 @@ class AccompanyingPeriodValidityValidator extends ConstraintValidator
|
||||
throw new UnexpectedValueException($period, AccompanyingPeriod::class);
|
||||
}
|
||||
|
||||
dump($period);
|
||||
|
||||
$socialIssues = [];
|
||||
|
||||
$activities = $this->activityRepository->findByAccompanyingPeriod($period, 'SEE');
|
||||
dump($activities);
|
||||
|
||||
foreach ($activities as $activity) {
|
||||
$socialIssues[] = $activity->getSocialIssues();
|
||||
$socialIssues = $activity->getSocialIssues()->getValues();
|
||||
}
|
||||
|
||||
foreach ($period->getWorks() as $work) {
|
||||
$socialIssues[] = $work->getSocialIssues();
|
||||
$socialIssues[] = $work->getSocialAction()->getIssue();
|
||||
}
|
||||
dump($socialIssues);
|
||||
|
||||
foreach ($period->getSocialIssues() as $si) {
|
||||
dump($si);
|
||||
if (!in_array($si, $socialIssues)) {
|
||||
foreach ($socialIssues as $si) {
|
||||
if (!in_array($si, $period->getSocialIssues()->getValues(), true)) {
|
||||
$this->context
|
||||
->buildViolation(
|
||||
$constraint->messageSocialIssueCannotBeDeleted
|
||||
|
Loading…
x
Reference in New Issue
Block a user