Server
in package
Uses
SingletonTrait
Class responsible for loading the REST API and all REST API namespaces.
Table of Contents
- CONTROLLERS_V1 = array('bookings' => 'BookingsController', 'reservations' => 'ReservationsController', 'services' => 'ServicesController', 'locations' => 'LocationsController', 'employees' => 'EmployeesController')
- CONTROLLERS_V_MOTOPRESS_APPOINTMENT_V1 = array('bookings' => 'BookingsRestController', 'bookings_calendar' => 'CalendarRestController', 'payments' => 'PaymentsRestController', 'schedules' => 'SchedulesRestController', 'services' => 'ServicesRestController', 'settings' => 'SettingsRestController', 'coupons' => 'CouponRestController')
- NAMESPACE_V1 = __NAMESPACE__ . '\\Controllers\\V1\\'
- NAMESPACE_V_MOTOPRESS_APPOINTMENT_V1 = __NAMESPACE__ . '\\Controllers\\Motopress\\Appointment\\V1\\'
- todo: delete when all features are migrated to mpa/v1
- $controllers : array<string|int, mixed>
- REST API namespaces and endpoints.
- $instance : object
- The single instance of the class.
- __wakeup() : mixed
- Prevent unserializing.
- init() : mixed
- Hook into WordPress ready to init the REST API as needed.
- instance() : object
- Get class instance.
- registerRestRoutes() : mixed
- Register REST API routes.
- __construct() : void
- Constructor
- __clone() : mixed
- Prevent cloning.
- getControllers() : array<string|int, mixed>
- List of controllers with their namespace for mpa/$version
- getRestNamespaces() : array<string|int, mixed>
- Get API namespaces - new namespaces should be registered here.
Constants
CONTROLLERS_V1
public
array<string|int, mixed>
CONTROLLERS_V1
= array('bookings' => 'BookingsController', 'reservations' => 'ReservationsController', 'services' => 'ServicesController', 'locations' => 'LocationsController', 'employees' => 'EmployeesController')
CONTROLLERS_V_MOTOPRESS_APPOINTMENT_V1
public
array<string|int, mixed>
CONTROLLERS_V_MOTOPRESS_APPOINTMENT_V1
= array('bookings' => 'BookingsRestController', 'bookings_calendar' => 'CalendarRestController', 'payments' => 'PaymentsRestController', 'schedules' => 'SchedulesRestController', 'services' => 'ServicesRestController', 'settings' => 'SettingsRestController', 'coupons' => 'CouponRestController')
NAMESPACE_V1
public
mixed
NAMESPACE_V1
= __NAMESPACE__ . '\\Controllers\\V1\\'
NAMESPACE_V_MOTOPRESS_APPOINTMENT_V1
todo: delete when all features are migrated to mpa/v1
public
mixed
NAMESPACE_V_MOTOPRESS_APPOINTMENT_V1
= __NAMESPACE__ . '\\Controllers\\Motopress\\Appointment\\V1\\'
Properties
$controllers
REST API namespaces and endpoints.
protected
array<string|int, mixed>
$controllers
= array()
$instance
The single instance of the class.
protected
static object
$instance
= null
Methods
__wakeup()
Prevent unserializing.
public
final __wakeup() : mixed
Return values
mixed —init()
Hook into WordPress ready to init the REST API as needed.
public
init() : mixed
Return values
mixed —instance()
Get class instance.
public
final static instance() : object
Return values
object —Instance.
registerRestRoutes()
Register REST API routes.
public
registerRestRoutes() : mixed
Return values
mixed —__construct()
Constructor
protected
__construct() : void
Return values
void —__clone()
Prevent cloning.
private
__clone() : mixed
Return values
mixed —getControllers()
List of controllers with their namespace for mpa/$version
private
getControllers(int $version) : array<string|int, mixed>
Parameters
- $version : int
-
Version of Api
Return values
array<string|int, mixed> —getRestNamespaces()
Get API namespaces - new namespaces should be registered here.
private
getRestNamespaces() : array<string|int, mixed>
Return values
array<string|int, mixed> —List of Namespaces and Main controller classes.