feat: functionality to determine family status of a booking
This commit is contained in:
1 parent
eed7ba4d7b
commit
582fb9b52d
2 files changed
+53
No files matched your search
@@ -106,4 +106,23 @@ class ParticipantDto
|
||||
{
|
||||
return 'O' === $this->status;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the participant's current age in complete years.
|
||||
*
|
||||
* Uses the same logic as existing age evaluators in the system
|
||||
* for consistency across age-related calculations.
|
||||
*
|
||||
* @return int|null The calculated age in complete years, or null if no birth date
|
||||
*/
|
||||
public function getAge(): ?int
|
||||
{
|
||||
if (null === $this->dateOfBirth) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$today = new \DateTimeImmutable();
|
||||
|
||||
return $this->dateOfBirth->diff($today)->y;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user