bookingStart = $bookingStart; $this->bookingEnd = $bookingEnd; $this->serviceId = $serviceId; $this->providerId = $providerId; } /** * @return Id */ public function getServiceId() { return $this->serviceId; } /** * @param Id $serviceId */ public function setServiceId(Id $serviceId) { $this->serviceId = $serviceId; } /** * @return Service */ public function getService() { return $this->service; } /** * @param Service $service */ public function setService(Service $service) { $this->service = $service; } /** * @return Id */ public function getProviderId() { return $this->providerId; } /** * @param Id $providerId */ public function setProviderId(Id $providerId) { $this->providerId = $providerId; } /** * @return Provider */ public function getProvider() { return $this->provider; } /** * @param Provider $provider */ public function setProvider(Provider $provider) { $this->provider = $provider; } /** * @return Token */ public function getGoogleCalendarEventId() { return $this->googleCalendarEventId; } /** * @param Token $googleCalendarEventId */ public function setGoogleCalendarEventId($googleCalendarEventId) { $this->googleCalendarEventId = $googleCalendarEventId; } /** * @return DateTimeValue */ public function getBookingStart() { return $this->bookingStart; } /** * @param DateTimeValue $bookingStart */ public function setBookingStart(DateTimeValue $bookingStart) { $this->bookingStart = $bookingStart; } /** * @return DateTimeValue */ public function getBookingEnd() { return $this->bookingEnd; } /** * @param DateTimeValue $bookingEnd */ public function setBookingEnd(DateTimeValue $bookingEnd) { $this->bookingEnd = $bookingEnd; } /** * @return BookingType */ public function getType() { return new Bookingtype(Entities::APPOINTMENT); } /** * @return array */ public function toArray() { return array_merge( parent::toArray(), [ 'serviceId' => $this->getServiceId()->getValue(), 'providerId' => $this->getProviderId()->getValue(), 'provider' => null !== $this->getProvider() ? $this->getProvider()->toArray() : null, 'service' => null !== $this->getService() ? $this->getService()->toArray() : null, 'googleCalendarEventId' => null !== $this->getGoogleCalendarEventId() ? $this->getGoogleCalendarEventId()->getValue() : null, 'bookingStart' => $this->getBookingStart()->getValue()->format('Y-m-d H:i:s'), 'bookingEnd' => $this->getBookingEnd()->getValue()->format('Y-m-d H:i:s'), 'type' => $this->getType()->getValue() ] ); } }