mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Merge conflicts fixed
This commit is contained in:
@@ -784,12 +784,18 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
* If the `$at` parameter is now, use the method `getCurrentPersonAddress`, which is optimized
|
||||
* on database side.
|
||||
*
|
||||
* @deprecated since chill2.0, address is linked to the household. Use @see{Person::getCurrentHouseholdAddress}
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getAddressAt(?DateTime $at = null): ?Address
|
||||
public function getAddressAt(?DateTimeInterface $at = null): ?Address
|
||||
{
|
||||
$at ??= new DateTime('now');
|
||||
|
||||
if ($at instanceof DateTimeImmutable) {
|
||||
$at = DateTime::createFromImmutable($at);
|
||||
}
|
||||
|
||||
/** @var ArrayIterator $addressesIterator */
|
||||
$addressesIterator = $this->getAddresses()
|
||||
->filter(static fn (Address $address): bool => $address->getValidFrom() <= $at)
|
||||
@@ -950,6 +956,12 @@ class Person implements HasCenterInterface, TrackCreationInterface, TrackUpdateI
|
||||
: null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the household address at the given date.
|
||||
*
|
||||
* if the given date is 'now', use instead @see{getCurrentPersonAddress}, which is optimized on
|
||||
* database side.
|
||||
*/
|
||||
public function getCurrentHouseholdAddress(?DateTimeImmutable $at = null): ?Address
|
||||
{
|
||||
if (
|
||||
|
Reference in New Issue
Block a user