Skip to content

Commit

Permalink
Merge pull request #77 from cultuurnet/feature/PUBLIQ-1026
Browse files Browse the repository at this point in the history
PUBLIQ-1026: Added availableFrom and availableTo properties
  • Loading branch information
zuuperman authored Apr 22, 2024
2 parents b6e7499 + 2d88757 commit 0ea6839
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/ValueObjects/Offer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}
5 changes: 5 additions & 0 deletions test/Serializer/SerializerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 0ea6839

Please sign in to comment.