PluginProbe
Cookie Consent – GDPR & CCPA Cookie Banner & Consent Manager / trunk
Cookie Consent – GDPR & CCPA Cookie Banner & Consent Manager vtrunk
0.0.11 0.0.10 0.0.9 0.0.8 0.0.7 0.0.6 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5
cookiez / modules / cookie / module.php

module.php in Cookie Consent – GDPR & CCPA Cookie Banner & Consent Manager trunk, at modules/cookie/module.php

62 lines 977 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Cookiez\Modules\Cookie;
4
5 use Cookiez\Classes\Module_Base;
6 use Cookiez\Modules\Cookie\Database\Cookie_Table;
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 /**
13 * Module `Cookie`
14 * Manages cookie entity storage and relationships
15 */
16 class Module extends Module_Base {
17
18 /**
19 * Get module name
20 * @return string
21 */
22 public function get_name(): string {
23 return 'Cookie';
24 }
25
26 /**
27 * Get list of REST routes
28 * @return array
29 */
30 public static function routes_list(): array {
31 return [
32 'Create_Cookie',
33 'Get_Cookies',
34 'Update_Cookie',
35 'Delete_Cookie',
36 ];
37 }
38
39 public static function component_list(): array {
40 return [
41 'Cookie',
42 ];
43 }
44
45 /**
46 * Install database tables
47 * Called on plugin activation
48 */
49 public static function install_tables(): void {
50 Cookie_Table::install();
51 }
52
53 /**
54 * Constructor
55 */
56 public function __construct() {
57 $this->install_tables();
58 $this->register_components();
59 $this->register_routes();
60 }
61 }
62