diff --git a/src/ValueObjects/Offer.php b/src/ValueObjects/Offer.php index 8f6ab9b..2549383 100644 --- a/src/ValueObjects/Offer.php +++ b/src/ValueObjects/Offer.php @@ -174,6 +174,18 @@ abstract class Offer */ private $status; + /** + * @var DateTime|null + * @Type("DateTime") + */ + private $availableFrom = null; + + /** + * @var DateTime|null + * @Type("DateTime") + */ + private $availableTo = null; + public function getId(): ?string { return $this->id; @@ -500,4 +512,24 @@ public function setStatus(Status $status): void { $this->status = $status; } + + public function getAvailableFrom(): ?DateTime + { + return $this->availableFrom; + } + + public function setAvailableFrom(?DateTime $availableFrom): void + { + $this->availableFrom = $availableFrom; + } + + public function getAvailableTo(): ?DateTime + { + return $this->availableTo; + } + + public function setAvailableTo(?DateTime $availableTo): void + { + $this->availableTo = $availableTo; + } } diff --git a/test/Serializer/SerializerTest.php b/test/Serializer/SerializerTest.php index 21b1c71..5663bfa 100644 --- a/test/Serializer/SerializerTest.php +++ b/test/Serializer/SerializerTest.php @@ -134,6 +134,9 @@ public function testDeserializeMethodForResultsWithEmbedAndFacets(): void ], ])); + $event->setAvailableFrom(new \DateTime('2021-01-13T12:00:38+01:00')); + $event->setAvailableTo(new \DateTime('2021-03-04T22:59:59+00:00')); + $event->setStatus( new Status( 'Available', @@ -267,6 +270,8 @@ public function testDeserializeMethodForResultsWithEmbedAndFacets(): void $location->setAddress($addresses); $location->setCalendarType('permanent'); + $location->setAvailableFrom(new \DateTime('2013-10-19T01:19:59+02:00')); + $location->setAvailableTo(new \DateTime('2100-01-01T00:00:00+00:00')); $locationTerm = new Term(); $locationTerm->setId('0.8.0.0.0');