PluginProbe
Bookit — Booking & Appointment Calendar / 2.6.0.5
Bookit — Booking & Appointment Calendar v2.6.0.5
2.6.0.5 2.6.0.4 2.6.0.3 2.6.0.2 2.6.0.1 2.6.0 trunk 1.2 1.2.2 1.2.3 2.0.0 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.1.1 2.1.2 2.1.3 2.1.4 All 62 releases
bookit / src / Bookit / REST / Provider.php

Provider.php in Bookit — Booking & Appointment Calendar 2.6.0.5, at src/Bookit/REST/Provider.php

65 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Provider for REST Functionality.
4 *
5 * @since 2.5.0
6 *
7 * @package Bookit\REST
8 */
9
10 namespace Bookit\REST;
11
12 use Bookit\Contracts\Service_Provider;
13 use Bookit\REST\V1\Documentation\OpenAPI_Documentation;
14
15 /**
16 * Class Provider
17 *
18 * Provides the functionality for REST API.
19 *
20 * @since 2.5.0
21 *
22 * @package Bookit\REST
23 */
24 class Provider extends Service_Provider {
25
26 /**
27 * Binds and sets up implementations.
28 *
29 * @since 2.5.0
30 */
31 public function register() {
32 // Register the SP on the container.
33 $this->container->singleton( 'bookit.rests.provider', $this );
34 $this->container->singleton( OpenAPI_Documentation::class, OpenAPI_Documentation::class );
35
36 $this->add_actions();
37 $this->add_filters();
38 }
39
40 /**
41 * Adds required actions for REST API.
42 *
43 * @since 2.5.0
44 */
45 protected function add_actions() {
46 add_action( 'rest_api_init', [ $this, 'register_endpoints' ] );
47 }
48
49 /**
50 * Registers the REST API endpoints for ESM.
51 *
52 * @since 2.5.0
53 */
54 public function register_endpoints() {
55 $this->container->make( OpenAPI_Documentation::class )->register();
56 }
57
58 /**
59 * Adds required filters for REST API.
60 *
61 * @since 2.5.0
62 */
63 protected function add_filters() {}
64 }
65