add address suggestion by household

This commit is contained in:
2021-07-29 16:01:17 +02:00
parent 5ef5b65d90
commit 886924a7e5
4 changed files with 122 additions and 5 deletions

View File

@@ -77,13 +77,15 @@ class PersonApiController extends ApiController
$a = $participation->getAccompanyingPeriod()->getAddressLocation();
$addresses[$a->getId()] = $a;
}
if (null !== $participation->getAccompanyingPeriod()->getPersonLocation()) {
$a = $participation->getAccompanyingPeriod()->getAddressLocation();
$addresses[$a->getId()] = $a;
if (null !== $personLocation = $participation
->getAccompanyingPeriod()->getPersonLocation()) {
$a = $personLocation->getCurrentHouseholdAddress();
if (null !== $a) {
$addresses[$a->getId()] = $a;
}
}
}
\array_unique($addresses);
// remove the actual address
$actual = $person->getCurrentHouseholdAddress();
if (null !== $actual) {