Show alt names in person search results

This commit is contained in:
2021-11-05 12:52:31 +00:00
parent 74df496e38
commit 5111a0ff6a
6 changed files with 72 additions and 95 deletions

View File

@@ -1283,11 +1283,14 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
/**
* get the address associated with the person at the given date
*
* If the `$at` parameter is now, use the method `getCurrentPersonAddress`, which is optimized
* on database side.
*
* @param DateTime|null $at
* @return Address|null
* @throws \Exception
*/
public function getCurrentPersonAddress(?\DateTime $at = null): ?Address
public function getAddressAt(?\DateTime $at = null): ?Address
{
$at ??= new DateTime('now');
@@ -1305,6 +1308,20 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
current($addresses);
}
/**
* Get the current person address
*
* @return Address|null
*/
public function getCurrentPersonAddress(): ?Address
{
if (null === $this->currentPersonAddress) {
return null;
}
return $this->currentPersonAddress->getAddress();
}
/**
* Validation callback that checks if the accompanying periods are valid
*