<?php

class AppointmentSlotDetails implements \JsonSerializable
{
    private $date;
    private $start_time;
    private $end_time;
    private $slot_str;

    public function __construct()
    {
        
    }

    public function setAllFromStr($wsdl_response_str)
    {
        $this->slot_str = $wsdl_response_str;
        // Sample string: dd/mm/yyyy hh:mm hh:mm
        $appointment_parts = explode(" ", $wsdl_response_str);

        $this->date = $appointment_parts[0];
        $this->start_time = $appointment_parts[1];
        $this->end_time = $appointment_parts[2];
    }

    public function getSlotStr(){
        return $this->slot_str;
    }

    public function getDate()
    {
        return $this->date;
    }

    public function getStartTime()
    {
        return $this->start_time;
    }

    public function getEndTime()
    {
        return $this->end_time;
    }

    public function jsonSerialize()
    {
        return get_object_vars($this);
    }
}

?>