1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace EventEspresso\core\services\addon\api\v1; |
4
|
|
|
|
5
|
|
|
use EventEspresso\core\services\addon\api\AddonApiVersion; |
6
|
|
|
|
7
|
|
|
class AddonApi extends AddonApiVersion |
8
|
|
|
{ |
9
|
|
|
|
10
|
|
|
/** |
11
|
|
|
* @var DataMigrationApi |
12
|
|
|
*/ |
13
|
|
|
private $data_migration_api; |
14
|
|
|
|
15
|
|
|
/** |
16
|
|
|
* @var LegacyModelApi |
17
|
|
|
*/ |
18
|
|
|
private $legacy_model_api; |
19
|
|
|
|
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Bootstrap constructor. |
23
|
|
|
* |
24
|
|
|
* @param string $slug |
25
|
|
|
* @param string $name |
26
|
|
|
* @param string $namespace |
27
|
|
|
* @param string $version |
28
|
|
|
* @param string $min_core_version |
29
|
|
|
* @param string $main_file |
30
|
|
|
*/ |
31
|
|
|
public function __construct( |
32
|
|
|
string $slug, |
33
|
|
|
string $name, |
34
|
|
|
string $namespace, |
35
|
|
|
string $version, |
36
|
|
|
string $min_core_version, |
37
|
|
|
string $main_file |
38
|
|
|
) { |
39
|
|
|
parent::__construct( |
40
|
|
|
$slug, |
41
|
|
|
$name, |
42
|
|
|
$namespace, |
43
|
|
|
$version, |
44
|
|
|
$min_core_version, |
45
|
|
|
$main_file, |
46
|
|
|
AddonApiVersion::V1 |
47
|
|
|
); |
48
|
|
|
$this->legacy_model_api = new LegacyModelApi(); |
49
|
|
|
$this->data_migration_api = new DataMigrationApi(); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @return string |
55
|
|
|
*/ |
56
|
|
|
public function dataMigrationScripts(): string |
57
|
|
|
{ |
58
|
|
|
return $this->data_migration_api->dataMigrationScripts(); |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
|
62
|
|
|
/** |
63
|
|
|
* @param string $data_migration_scripts |
64
|
|
|
*/ |
65
|
|
|
public function addDataMigrationScripts(string $data_migration_scripts): void |
66
|
|
|
{ |
67
|
|
|
$this->data_migration_api->addDataMigrationScripts($data_migration_scripts); |
68
|
|
|
} |
69
|
|
|
|
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @return string |
73
|
|
|
*/ |
74
|
|
|
public function entityClasses(): string |
75
|
|
|
{ |
76
|
|
|
return $this->legacy_model_api->entityClasses(); |
77
|
|
|
} |
78
|
|
|
|
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @param string $entity_classes |
82
|
|
|
*/ |
83
|
|
|
public function addEntityClasses(string $entity_classes): void |
84
|
|
|
{ |
85
|
|
|
$this->legacy_model_api->addEntityClasses($entity_classes); |
86
|
|
|
} |
87
|
|
|
|
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @return string |
91
|
|
|
*/ |
92
|
|
|
public function entityModels(): string |
93
|
|
|
{ |
94
|
|
|
return $this->legacy_model_api->entityModels(); |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @param string $entity_models |
100
|
|
|
*/ |
101
|
|
|
public function addEntityModels(string $entity_models): void |
102
|
|
|
{ |
103
|
|
|
$this->legacy_model_api->addEntityModels($entity_models); |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @return string |
109
|
|
|
*/ |
110
|
|
|
public function entityClassExtensions(): string |
111
|
|
|
{ |
112
|
|
|
return $this->legacy_model_api->entityClassExtensions(); |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @param string $entity_class_extensions |
118
|
|
|
*/ |
119
|
|
|
public function addEntityClassExtensions(string $entity_class_extensions): void |
120
|
|
|
{ |
121
|
|
|
$this->legacy_model_api->addEntityClassExtensions($entity_class_extensions); |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
|
125
|
|
|
/** |
126
|
|
|
* @return string |
127
|
|
|
*/ |
128
|
|
|
public function entityModelExtensions(): string |
129
|
|
|
{ |
130
|
|
|
return $this->legacy_model_api->entityModelExtensions(); |
131
|
|
|
} |
132
|
|
|
|
133
|
|
|
|
134
|
|
|
/** |
135
|
|
|
* @param string $entity_model_extensions |
136
|
|
|
*/ |
137
|
|
|
public function addEntityModelExtensions(string $entity_model_extensions): void |
138
|
|
|
{ |
139
|
|
|
$this->legacy_model_api->addEntityModelExtensions($entity_model_extensions); |
140
|
|
|
} |
141
|
|
|
} |
142
|
|
|
|