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', 'booking_availability' => 'BookingAvailabilityController', 'payments' => 'PaymentsController', 'accommodations' => 'AccommodationsController', 'accommodation_types' => 'AccommodationTypesController', 'accommodation_type_categories' => 'AccommodationTypeCategoriesController', 'accommodation_type_tags' => 'AccommodationTypeTagsController', 'accommodation_type_amenities' => 'AccommodationTypeAmenitiesController', 'accommodation_type_services' => 'AccommodationTypeServicesController', 'accommodation_type_images' => 'AccommodationTypeImagesController', 'accommodation_type_attributes' => 'AccommodationTypeAttributesController', 'accommodation_type_attribute_terms' => 'AccommodationTypeAttributeTermsController', 'coupons' => 'CouponsController', 'rates' => 'RatesController', 'seasons' => 'SeasonsController', 'booking_rules' => 'BookingRulesController', 'taxes_and_fees' => 'TaxesAndFeesController')
- NAMESPACE_V1 = __NAMESPACE__ . '\\Controllers\\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 whit their namespace for mphb/$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', 'booking_availability' => 'BookingAvailabilityController', 'payments' => 'PaymentsController', 'accommodations' => 'AccommodationsController', 'accommodation_types' => 'AccommodationTypesController', 'accommodation_type_categories' => 'AccommodationTypeCategoriesController', 'accommodation_type_tags' => 'AccommodationTypeTagsController', 'accommodation_type_amenities' => 'AccommodationTypeAmenitiesController', 'accommodation_type_services' => 'AccommodationTypeServicesController', 'accommodation_type_images' => 'AccommodationTypeImagesController', 'accommodation_type_attributes' => 'AccommodationTypeAttributesController', 'accommodation_type_attribute_terms' => 'AccommodationTypeAttributeTermsController', 'coupons' => 'CouponsController', 'rates' => 'RatesController', 'seasons' => 'SeasonsController', 'booking_rules' => 'BookingRulesController', 'taxes_and_fees' => 'TaxesAndFeesController')
NAMESPACE_V1
public
mixed
NAMESPACE_V1
= __NAMESPACE__ . '\\Controllers\\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 whit their namespace for mphb/$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.