PluginProbe
Yatra – Travel Booking & Tour Operator Software / 2.2.13
Yatra – Travel Booking & Tour Operator Software v2.2.13
3.0.14 3.0.14.1 3.0.14.2 3.0.12 3.0.13 3.0.11 3.0.10 3.0.9 3.0.8 3.0.7 3.0.6 3.0.5 3.0.5.1 3.0.4 3.0.3 3.0.2.9 3.0.2.7 3.0.2.8 3.0.2.6 trunk 1.0.0 2.0.0 2.0.1 2.0.10 2.0.11 All 82 releases
yatra / core / API / RestBase.php

RestBase.php in Yatra – Travel Booking & Tour Operator Software 2.2.13, at core/API/RestBase.php

37 lines 797 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Yatra\Core\API;
4
5 abstract class RestBase
6 {
7 protected $rest_route_id = '';
8
9 protected $namespace = YATRA_REST_WEBHOOKS_NAMESPACE;
10
11
12 protected $method = \WP_REST_Server::READABLE;
13
14
15 public function __construct()
16 {
17 add_action('rest_api_init', array($this, 'register_routes'));
18 }
19
20 public function register_routes()
21 {
22 register_rest_route($this->namespace, $this->rest_route_id, array(
23 'methods' => $this->method,
24 'permission_callback' => array($this, 'validate'),
25 'callback' => array($this, 'handle')
26 ));
27 }
28
29 abstract public function validate(\WP_REST_Request $request);
30
31 abstract public function handle(\WP_REST_Request $request);
32
33 abstract public static function init();
34
35 }
36
37