chore: add utility methods
This commit is contained in:
@@ -116,8 +116,7 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
->setPickupDate($assignment->getPickupDate())
|
||||
->setPickup($assignment->getPickup())
|
||||
->setBenefits($assignment->getBenefits())
|
||||
->setContact($assignment->getContact())
|
||||
;
|
||||
->setContact($assignment->getContact());
|
||||
|
||||
$assignment->getFees()->map(function (Fee $fee) use ($instance) {
|
||||
$instance->addFee($fee);
|
||||
@@ -224,6 +223,24 @@ class Assignment implements BlameableEntityInterface, TimestampableEntityInterfa
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getEffectiveDateFrom(): ?\DateTimeImmutable
|
||||
{
|
||||
if (null !== $effectivePeriod = $this->getEffectivePeriod()) {
|
||||
return $effectivePeriod->start->toDateTimeImmutable();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getEffectiveDateTo(): ?\DateTimeImmutable
|
||||
{
|
||||
if (null !== $effectivePeriod = $this->getEffectivePeriod()) {
|
||||
return $effectivePeriod->end->toDateTimeImmutable();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getEffectivePickupDate(): ?\DateTimeImmutable
|
||||
{
|
||||
if (null !== $this->pickupDate) {
|
||||
|
||||
Reference in New Issue
Block a user