id; } /** * @param Id $id */ public function setId(Id $id) { $this->id = $id; } /** * @return Id */ public function getEventId() { return $this->eventId; } /** * @param Id $eventId */ public function setEventId(Id $eventId) { $this->eventId = $eventId; } /** * @return DateTimeValue */ public function getPeriodStart() { return $this->periodStart; } /** * @param DateTimeValue $periodStart */ public function setPeriodStart(DateTimeValue $periodStart) { $this->periodStart = $periodStart; } /** * @return DateTimeValue */ public function getPeriodEnd() { return $this->periodEnd; } /** * @param DateTimeValue $periodEnd */ public function setPeriodEnd(DateTimeValue $periodEnd) { $this->periodEnd = $periodEnd; } /** * @return Collection */ public function getBookings() { return $this->bookings; } /** * @param Collection $bookings */ public function setBookings(Collection $bookings) { $this->bookings = $bookings; } /** * @return array */ public function toArray() { return [ 'id' => $this->getId() ? $this->getId()->getValue() : null, 'eventId' => $this->getEventId() ? $this->getEventId()->getValue() : null, 'periodStart' => $this->getPeriodStart()->getValue()->format('Y-m-d H:i:s'), 'periodEnd' => $this->getPeriodEnd()->getValue()->format('Y-m-d H:i:s'), 'bookings' => $this->getBookings() ? $this->getBookings()->toArray() : [], ]; } }