mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 22:04:23 +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);
|
throw new UnexpectedValueException($period, AccompanyingPeriod::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
dump($period);
|
|
||||||
|
|
||||||
$socialIssues = [];
|
$socialIssues = [];
|
||||||
|
|
||||||
$activities = $this->activityRepository->findByAccompanyingPeriod($period, 'SEE');
|
$activities = $this->activityRepository->findByAccompanyingPeriod($period, 'SEE');
|
||||||
dump($activities);
|
|
||||||
foreach ($activities as $activity) {
|
foreach ($activities as $activity) {
|
||||||
$socialIssues[] = $activity->getSocialIssues();
|
$socialIssues = $activity->getSocialIssues()->getValues();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($period->getWorks() as $work) {
|
foreach ($period->getWorks() as $work) {
|
||||||
$socialIssues[] = $work->getSocialIssues();
|
$socialIssues[] = $work->getSocialAction()->getIssue();
|
||||||
}
|
}
|
||||||
dump($socialIssues);
|
|
||||||
|
|
||||||
foreach ($period->getSocialIssues() as $si) {
|
foreach ($socialIssues as $si) {
|
||||||
dump($si);
|
if (!in_array($si, $period->getSocialIssues()->getValues(), true)) {
|
||||||
if (!in_array($si, $socialIssues)) {
|
|
||||||
$this->context
|
$this->context
|
||||||
->buildViolation(
|
->buildViolation(
|
||||||
$constraint->messageSocialIssueCannotBeDeleted
|
$constraint->messageSocialIssueCannotBeDeleted
|
||||||
|
Loading…
x
Reference in New Issue
Block a user