PluginProbe
HivePress – Business Directory, Listings & Classified Ads Plugin / trunk
HivePress – Business Directory, Listings & Classified Ads Plugin vtrunk
1.7.31 1.7.30 1.7.29 1.7.28 1.7.27 1.7.26 1.7.25 1.7.24 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 All 98 releases
hivepress / includes / controllers / class-controller.php

class-controller.php in HivePress – Business Directory, Listings & Classified Ads Plugin trunk, at includes/controllers/class-controller.php

66 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Abstract controller.
4 *
5 * @package HivePress\Controllers
6 */
7
8 namespace HivePress\Controllers;
9
10 use HivePress\Helpers as hp;
11 use HivePress\Traits;
12
13 // Exit if accessed directly.
14 defined( 'ABSPATH' ) || exit;
15
16 /**
17 * Abstract controller class.
18 *
19 * @OA\Server(url="/wp-json/hivepress/v1", description="")
20 * @OA\Info(
21 * title="HivePress REST API",
22 * version="1.0",
23 * description="This is a reference of all the endpoints available in HivePress REST API. Since it's based on WordPress REST API, you can refer to the [WordPress documentation](https://developer.wordpress.org/rest-api/) for the available authentication methods and more details."
24 * )
25 */
26 abstract class Controller {
27 use Traits\Mutator;
28
29 /**
30 * Controller routes.
31 *
32 * @var array
33 */
34 protected $routes = [];
35
36 /**
37 * Class constructor.
38 *
39 * @param array $args Controller arguments.
40 */
41 public function __construct( $args = [] ) {
42
43 // Set properties.
44 foreach ( $args as $name => $value ) {
45 $this->set_property( $name, $value );
46 }
47
48 // Bootstrap properties.
49 $this->boot();
50 }
51
52 /**
53 * Bootstraps controller properties.
54 */
55 protected function boot() {}
56
57 /**
58 * Gets controller routes.
59 *
60 * @return array
61 */
62 final public function get_routes() {
63 return $this->routes;
64 }
65 }
66