# booktics/1.0.13/core/appointment/schedule/time-slot.php

Booktics – Appointment Booking Calendar for Service Businesses, version 1.0.13. 96 lines.

- Page: https://pluginprobe.com/plugins/booktics/1.0.13/code/core/appointment/schedule/time-slot.php
- Raw: https://pluginprobe.com/plugins/booktics/1.0.13/raw/core/appointment/schedule/time-slot.php
- Modified: 2026-01-07T04:33:10+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/booktics/1.0.13/code/core/appointment/schedule/time-slot.php#L10-L20`.

```php
<?php
namespace Booktics\Appointment\Schedule;

use JsonSerializable;

/**
 * Timeslot class
 */
class Time_Slot implements JsonSerializable {
    /**
     * Store start time
     *
     * @var string
     */
    public $start;

    /**
     * Store end time
     *
     * @var string
     */
    public $end;

    /**
     * Store time slot status
     *
     * @var bool
     */
    public $is_available;

    /**
     * Store maximum capacity
     *
     * @var int
     */
    public $max_capacity;

    /**
     * Store booked count
     *
     * @var int
     */
    public $booked_count;

    /**
     * Store available spots
     *
     * @var int
     */
    public $available_spots;

    /**
     * Constructor timeslot class
     *
     * @param   string  $start        Start time for a time slot
     * @param   string  $end          End time for a time slot
     * @param   bool    $is_available  Status for time slot
     * @param   true
     *
     * @return  void
     */
    public function __construct( string $start, string $end, bool $is_available = true, int $max_capacity = 1, int $available_spots = 1, int $booked_count = 0 ) {
        $this->start        = $start;
        $this->end          = $end;
        $this->is_available = $is_available;
        $this->max_capacity = $max_capacity;
        $this->booked_count = $booked_count;
        $this->available_spots = $available_spots;
    }

    /**
     * Get time slot data as an array
     *
     * @return  array   Timeslot data
     */
    public function to_array(): array {
        return [
            'start'        => $this->start,
            'end'          => $this->end,
            'is_available' => $this->is_available,
            'max_capacity' => $this->max_capacity,
            'booked_count' => $this->booked_count,
            'available_spots' => $this->available_spots,
        ];
    }

    /**
     * Specify data which should be serialized to JSON.
     *
     * @return array
     */
    public function jsonSerialize(): array {
        return $this->to_array();
    }
}

```
