1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AlgoWeb\ODataMetadata\MetadataV3\mapping\cs; |
4
|
|
|
|
5
|
|
|
use AlgoWeb\ODataMetadata\IsOK; |
6
|
|
|
use AlgoWeb\ODataMetadata\MetadataV4\edm\IsOKTraits\TSimpleIdentifierTrait; |
7
|
|
|
|
8
|
|
|
/** |
9
|
|
|
* Class representing TEntityContainerMappingType |
10
|
|
|
* |
11
|
|
|
* |
12
|
|
|
* XSD Type: TEntityContainerMapping |
13
|
|
|
*/ |
14
|
|
|
class TEntityContainerMappingType extends IsOK |
15
|
|
|
{ |
16
|
|
|
use TSimpleIdentifierTrait; |
17
|
|
|
/** |
18
|
|
|
* @property string $cdmEntityContainer |
19
|
|
|
*/ |
20
|
|
|
private $cdmEntityContainer = null; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @property string $storageEntityContainer |
24
|
|
|
*/ |
25
|
|
|
private $storageEntityContainer = null; |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @property boolean $generateUpdateViews |
29
|
|
|
*/ |
30
|
|
|
private $generateUpdateViews = null; |
31
|
|
|
|
32
|
|
|
/** |
33
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TEntitySetMappingType[] $entitySetMapping |
34
|
|
|
*/ |
35
|
|
|
private $entitySetMapping = []; |
36
|
|
|
|
37
|
|
|
/** |
38
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TAssociationSetMappingType[] |
39
|
|
|
* $associationSetMapping |
40
|
|
|
*/ |
41
|
|
|
private $associationSetMapping = []; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TFunctionImportMappingType[] |
45
|
|
|
* $functionImportMapping |
46
|
|
|
*/ |
47
|
|
|
private $functionImportMapping = []; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Gets as cdmEntityContainer |
51
|
|
|
* |
52
|
|
|
* @return string |
53
|
|
|
*/ |
54
|
|
|
public function getCdmEntityContainer() |
55
|
|
|
{ |
56
|
|
|
return $this->cdmEntityContainer; |
57
|
|
|
} |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* Sets a new cdmEntityContainer |
61
|
|
|
* |
62
|
|
|
* @param string $cdmEntityContainer |
63
|
|
|
* @return self |
64
|
|
|
*/ |
65
|
|
|
public function setCdmEntityContainer($cdmEntityContainer) |
66
|
|
|
{ |
67
|
|
|
$this->cdmEntityContainer = $cdmEntityContainer; |
68
|
|
|
return $this; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Gets as storageEntityContainer |
73
|
|
|
* |
74
|
|
|
* @return string |
75
|
|
|
*/ |
76
|
|
|
public function getStorageEntityContainer() |
77
|
|
|
{ |
78
|
|
|
return $this->storageEntityContainer; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* Sets a new storageEntityContainer |
83
|
|
|
* |
84
|
|
|
* @param string $storageEntityContainer |
85
|
|
|
* @return self |
86
|
|
|
*/ |
87
|
|
|
public function setStorageEntityContainer($storageEntityContainer) |
88
|
|
|
{ |
89
|
|
|
$this->storageEntityContainer = $storageEntityContainer; |
90
|
|
|
return $this; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Gets as generateUpdateViews |
95
|
|
|
* |
96
|
|
|
* @return boolean |
97
|
|
|
*/ |
98
|
|
|
public function getGenerateUpdateViews() |
99
|
|
|
{ |
100
|
|
|
return $this->generateUpdateViews; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Sets a new generateUpdateViews |
105
|
|
|
* |
106
|
|
|
* @param boolean $generateUpdateViews |
107
|
|
|
* @return self |
108
|
|
|
*/ |
109
|
|
|
public function setGenerateUpdateViews($generateUpdateViews) |
110
|
|
|
{ |
111
|
|
|
$this->generateUpdateViews = $generateUpdateViews; |
112
|
|
|
return $this; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* Adds as entitySetMapping |
117
|
|
|
* |
118
|
|
|
* @return self |
119
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TEntitySetMappingType $entitySetMapping |
120
|
|
|
*/ |
121
|
|
|
public function addToEntitySetMapping(TEntitySetMappingType $entitySetMapping) |
122
|
|
|
{ |
123
|
|
|
$this->entitySetMapping[] = $entitySetMapping; |
124
|
|
|
return $this; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* isset entitySetMapping |
129
|
|
|
* |
130
|
|
|
* @param scalar $index |
131
|
|
|
* @return boolean |
132
|
|
|
*/ |
133
|
|
|
public function issetEntitySetMapping($index) |
134
|
|
|
{ |
135
|
|
|
return isset($this->entitySetMapping[$index]); |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* unset entitySetMapping |
140
|
|
|
* |
141
|
|
|
* @param scalar $index |
142
|
|
|
* @return void |
143
|
|
|
*/ |
144
|
|
|
public function unsetEntitySetMapping($index) |
145
|
|
|
{ |
146
|
|
|
unset($this->entitySetMapping[$index]); |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Gets as entitySetMapping |
151
|
|
|
* |
152
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TEntitySetMappingType[] |
153
|
|
|
*/ |
154
|
|
|
public function getEntitySetMapping() |
155
|
|
|
{ |
156
|
|
|
return $this->entitySetMapping; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* Sets a new entitySetMapping |
161
|
|
|
* |
162
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TEntitySetMappingType[] $entitySetMapping |
163
|
|
|
* @return self |
164
|
|
|
*/ |
165
|
|
|
public function setEntitySetMapping(array $entitySetMapping) |
166
|
|
|
{ |
167
|
|
|
$this->entitySetMapping = $entitySetMapping; |
168
|
|
|
return $this; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* Adds as associationSetMapping |
173
|
|
|
* |
174
|
|
|
* @return self |
175
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TAssociationSetMappingType $associationSetMapping |
176
|
|
|
*/ |
177
|
|
|
public function addToAssociationSetMapping(TAssociationSetMappingType $associationSetMapping) |
178
|
|
|
{ |
179
|
|
|
$this->associationSetMapping[] = $associationSetMapping; |
180
|
|
|
return $this; |
181
|
|
|
} |
182
|
|
|
|
183
|
|
|
/** |
184
|
|
|
* isset associationSetMapping |
185
|
|
|
* |
186
|
|
|
* @param scalar $index |
187
|
|
|
* @return boolean |
188
|
|
|
*/ |
189
|
|
|
public function issetAssociationSetMapping($index) |
190
|
|
|
{ |
191
|
|
|
return isset($this->associationSetMapping[$index]); |
192
|
|
|
} |
193
|
|
|
|
194
|
|
|
/** |
195
|
|
|
* unset associationSetMapping |
196
|
|
|
* |
197
|
|
|
* @param scalar $index |
198
|
|
|
* @return void |
199
|
|
|
*/ |
200
|
|
|
public function unsetAssociationSetMapping($index) |
201
|
|
|
{ |
202
|
|
|
unset($this->associationSetMapping[$index]); |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* Gets as associationSetMapping |
207
|
|
|
* |
208
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TAssociationSetMappingType[] |
209
|
|
|
*/ |
210
|
|
|
public function getAssociationSetMapping() |
211
|
|
|
{ |
212
|
|
|
return $this->associationSetMapping; |
213
|
|
|
} |
214
|
|
|
|
215
|
|
|
/** |
216
|
|
|
* Sets a new associationSetMapping |
217
|
|
|
* |
218
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TAssociationSetMappingType[] |
219
|
|
|
* $associationSetMapping |
220
|
|
|
* @return self |
221
|
|
|
*/ |
222
|
|
|
public function setAssociationSetMapping(array $associationSetMapping) |
223
|
|
|
{ |
224
|
|
|
$this->associationSetMapping = $associationSetMapping; |
225
|
|
|
return $this; |
226
|
|
|
} |
227
|
|
|
|
228
|
|
|
/** |
229
|
|
|
* Adds as functionImportMapping |
230
|
|
|
* |
231
|
|
|
* @return self |
232
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TFunctionImportMappingType $functionImportMapping |
233
|
|
|
*/ |
234
|
|
|
public function addToFunctionImportMapping(TFunctionImportMappingType $functionImportMapping) |
235
|
|
|
{ |
236
|
|
|
$this->functionImportMapping[] = $functionImportMapping; |
237
|
|
|
return $this; |
238
|
|
|
} |
239
|
|
|
|
240
|
|
|
/** |
241
|
|
|
* isset functionImportMapping |
242
|
|
|
* |
243
|
|
|
* @param scalar $index |
244
|
|
|
* @return boolean |
245
|
|
|
*/ |
246
|
|
|
public function issetFunctionImportMapping($index) |
247
|
|
|
{ |
248
|
|
|
return isset($this->functionImportMapping[$index]); |
249
|
|
|
} |
250
|
|
|
|
251
|
|
|
/** |
252
|
|
|
* unset functionImportMapping |
253
|
|
|
* |
254
|
|
|
* @param scalar $index |
255
|
|
|
* @return void |
256
|
|
|
*/ |
257
|
|
|
public function unsetFunctionImportMapping($index) |
258
|
|
|
{ |
259
|
|
|
unset($this->functionImportMapping[$index]); |
260
|
|
|
} |
261
|
|
|
|
262
|
|
|
/** |
263
|
|
|
* Gets as functionImportMapping |
264
|
|
|
* |
265
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TFunctionImportMappingType[] |
266
|
|
|
*/ |
267
|
|
|
public function getFunctionImportMapping() |
268
|
|
|
{ |
269
|
|
|
return $this->functionImportMapping; |
270
|
|
|
} |
271
|
|
|
|
272
|
|
|
/** |
273
|
|
|
* Sets a new functionImportMapping |
274
|
|
|
* |
275
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TFunctionImportMappingType[] |
276
|
|
|
* $functionImportMapping |
277
|
|
|
* @return self |
278
|
|
|
*/ |
279
|
|
|
public function setFunctionImportMapping(array $functionImportMapping) |
280
|
|
|
{ |
281
|
|
|
$this->functionImportMapping = $functionImportMapping; |
282
|
|
|
return $this; |
283
|
|
|
} |
284
|
|
|
|
285
|
|
|
public function isOK(&$msg = null) |
286
|
|
|
{ |
287
|
|
|
if (!$this->isStringNotNullOrEmpty($this->cdmEntityContainer)) { |
288
|
|
|
$msg = 'CDM entity container cannot be null or empty'; |
289
|
|
|
return false; |
290
|
|
|
} |
291
|
|
|
if (!$this->isStringNotNullOrEmpty($this->storageEntityContainer)) { |
292
|
|
|
$msg = 'Storage entity container cannot be null or empty'; |
293
|
|
|
return false; |
294
|
|
|
} |
295
|
|
|
if (!$this->isTSimpleIdentifierValid($this->cdmEntityContainer)) { |
296
|
|
|
$msg = 'CDM entity container must be a valid TSimpleIdentifier'; |
297
|
|
|
return false; |
298
|
|
|
} |
299
|
|
|
if (!$this->isValidArray( |
300
|
|
|
$this->entitySetMapping, |
301
|
|
|
'\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TEntitySetMappingType' |
302
|
|
|
)) { |
303
|
|
|
$msg = "Entity set mapping array not a valid array"; |
304
|
|
|
return false; |
305
|
|
|
} |
306
|
|
|
if (!$this->isChildArrayOK($this->entitySetMapping, $msg)) { |
307
|
|
|
return false; |
308
|
|
|
} |
309
|
|
|
if (!$this->isValidArray( |
310
|
|
|
$this->associationSetMapping, |
311
|
|
|
'\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TAssociationSetMappingType' |
312
|
|
|
)) { |
313
|
|
|
$msg = "Association set mapping array not a valid array"; |
314
|
|
|
return false; |
315
|
|
|
} |
316
|
|
|
if (!$this->isChildArrayOK($this->associationSetMapping, $msg)) { |
317
|
|
|
return false; |
318
|
|
|
} |
319
|
|
|
if (!$this->isValidArray( |
320
|
|
|
$this->functionImportMapping, |
321
|
|
|
'\AlgoWeb\ODataMetadata\MetadataV3\mapping\cs\TFunctionImportMappingType' |
322
|
|
|
)) { |
323
|
|
|
$msg = "Function import mapping array not a valid array"; |
324
|
|
|
return false; |
325
|
|
|
} |
326
|
|
|
if (!$this->isChildArrayOK($this->functionImportMapping, $msg)) { |
327
|
|
|
return false; |
328
|
|
|
} |
329
|
|
|
return true; |
330
|
|
|
} |
331
|
|
|
} |
332
|
|
|
|