mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
Show alt names in person search results
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user