1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AlgoWeb\ODataMetadata\MetadataV3\edmx; |
4
|
|
|
|
5
|
|
|
use AlgoWeb\ODataMetadata\IsOK; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class representing TDiagramType |
9
|
|
|
* |
10
|
|
|
* |
11
|
|
|
* XSD Type: TDiagram |
12
|
|
|
*/ |
13
|
|
|
class TDiagramType extends IsOK |
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @property string $name |
18
|
|
|
*/ |
19
|
|
|
private $name = null; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @property string $diagramId |
23
|
|
|
*/ |
24
|
|
|
private $diagramId = null; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @property integer $zoomLevel |
28
|
|
|
*/ |
29
|
|
|
private $zoomLevel = null; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @property boolean $showGrid |
33
|
|
|
*/ |
34
|
|
|
private $showGrid = null; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @property boolean $snapToGrid |
38
|
|
|
*/ |
39
|
|
|
private $snapToGrid = null; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @property boolean $displayType |
43
|
|
|
*/ |
44
|
|
|
private $displayType = null; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\edmx\TEntityTypeShapeType[] $entityTypeShape |
48
|
|
|
*/ |
49
|
|
|
private $entityTypeShape = []; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\edmx\TAssociationConnectorType[] $associationConnector |
53
|
|
|
*/ |
54
|
|
|
private $associationConnector = []; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @property \AlgoWeb\ODataMetadata\MetadataV3\edmx\TInheritanceConnectorType[] $inheritanceConnector |
58
|
|
|
*/ |
59
|
|
|
private $inheritanceConnector = []; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Gets as name |
63
|
|
|
* |
64
|
|
|
* @return string |
65
|
|
|
*/ |
66
|
|
|
public function getName() |
67
|
|
|
{ |
68
|
|
|
return $this->name; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* Sets a new name |
73
|
|
|
* |
74
|
|
|
* @param string $name |
75
|
|
|
* @return self |
76
|
|
|
*/ |
77
|
|
|
public function setName($name) |
78
|
|
|
{ |
79
|
|
|
$this->name = $name; |
80
|
|
|
return $this; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* Gets as diagramId |
85
|
|
|
* |
86
|
|
|
* @return string |
87
|
|
|
*/ |
88
|
|
|
public function getDiagramId() |
89
|
|
|
{ |
90
|
|
|
return $this->diagramId; |
91
|
|
|
} |
92
|
|
|
|
93
|
|
|
/** |
94
|
|
|
* Sets a new diagramId |
95
|
|
|
* |
96
|
|
|
* @param string $diagramId |
97
|
|
|
* @return self |
98
|
|
|
*/ |
99
|
|
|
public function setDiagramId($diagramId) |
100
|
|
|
{ |
101
|
|
|
$this->diagramId = $diagramId; |
102
|
|
|
return $this; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* Gets as zoomLevel |
107
|
|
|
* |
108
|
|
|
* @return integer |
109
|
|
|
*/ |
110
|
|
|
public function getZoomLevel() |
111
|
|
|
{ |
112
|
|
|
return $this->zoomLevel; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* Sets a new zoomLevel |
117
|
|
|
* |
118
|
|
|
* @param integer $zoomLevel |
119
|
|
|
* @return self |
120
|
|
|
*/ |
121
|
|
|
public function setZoomLevel($zoomLevel) |
122
|
|
|
{ |
123
|
|
|
$this->zoomLevel = $zoomLevel; |
124
|
|
|
return $this; |
125
|
|
|
} |
126
|
|
|
|
127
|
|
|
/** |
128
|
|
|
* Gets as showGrid |
129
|
|
|
* |
130
|
|
|
* @return boolean |
131
|
|
|
*/ |
132
|
|
|
public function getShowGrid() |
133
|
|
|
{ |
134
|
|
|
return $this->showGrid; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* Sets a new showGrid |
139
|
|
|
* |
140
|
|
|
* @param boolean $showGrid |
141
|
|
|
* @return self |
142
|
|
|
*/ |
143
|
|
|
public function setShowGrid($showGrid) |
144
|
|
|
{ |
145
|
|
|
$this->showGrid = $showGrid; |
146
|
|
|
return $this; |
147
|
|
|
} |
148
|
|
|
|
149
|
|
|
/** |
150
|
|
|
* Gets as snapToGrid |
151
|
|
|
* |
152
|
|
|
* @return boolean |
153
|
|
|
*/ |
154
|
|
|
public function getSnapToGrid() |
155
|
|
|
{ |
156
|
|
|
return $this->snapToGrid; |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* Sets a new snapToGrid |
161
|
|
|
* |
162
|
|
|
* @param boolean $snapToGrid |
163
|
|
|
* @return self |
164
|
|
|
*/ |
165
|
|
|
public function setSnapToGrid($snapToGrid) |
166
|
|
|
{ |
167
|
|
|
$this->snapToGrid = $snapToGrid; |
168
|
|
|
return $this; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* Gets as displayType |
173
|
|
|
* |
174
|
|
|
* @return boolean |
175
|
|
|
*/ |
176
|
|
|
public function getDisplayType() |
177
|
|
|
{ |
178
|
|
|
return $this->displayType; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* Sets a new displayType |
183
|
|
|
* |
184
|
|
|
* @param boolean $displayType |
185
|
|
|
* @return self |
186
|
|
|
*/ |
187
|
|
|
public function setDisplayType($displayType) |
188
|
|
|
{ |
189
|
|
|
$this->displayType = $displayType; |
190
|
|
|
return $this; |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* Adds as entityTypeShape |
195
|
|
|
* |
196
|
|
|
* @return self |
197
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TEntityTypeShapeType $entityTypeShape |
198
|
|
|
*/ |
199
|
|
|
public function addToEntityTypeShape(TEntityTypeShapeType $entityTypeShape) |
200
|
|
|
{ |
201
|
|
|
$this->entityTypeShape[] = $entityTypeShape; |
202
|
|
|
return $this; |
203
|
|
|
} |
204
|
|
|
|
205
|
|
|
/** |
206
|
|
|
* isset entityTypeShape |
207
|
|
|
* |
208
|
|
|
* @param scalar $index |
209
|
|
|
* @return boolean |
210
|
|
|
*/ |
211
|
|
|
public function issetEntityTypeShape($index) |
212
|
|
|
{ |
213
|
|
|
return isset($this->entityTypeShape[$index]); |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* unset entityTypeShape |
218
|
|
|
* |
219
|
|
|
* @param scalar $index |
220
|
|
|
* @return void |
221
|
|
|
*/ |
222
|
|
|
public function unsetEntityTypeShape($index) |
223
|
|
|
{ |
224
|
|
|
unset($this->entityTypeShape[$index]); |
225
|
|
|
} |
226
|
|
|
|
227
|
|
|
/** |
228
|
|
|
* Gets as entityTypeShape |
229
|
|
|
* |
230
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\edmx\TEntityTypeShapeType[] |
231
|
|
|
*/ |
232
|
|
|
public function getEntityTypeShape() |
233
|
|
|
{ |
234
|
|
|
return $this->entityTypeShape; |
235
|
|
|
} |
236
|
|
|
|
237
|
|
|
/** |
238
|
|
|
* Sets a new entityTypeShape |
239
|
|
|
* |
240
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TEntityTypeShapeType[] $entityTypeShape |
241
|
|
|
* @return self |
242
|
|
|
*/ |
243
|
|
|
public function setEntityTypeShape(array $entityTypeShape) |
244
|
|
|
{ |
245
|
|
|
$this->entityTypeShape = $entityTypeShape; |
246
|
|
|
return $this; |
247
|
|
|
} |
248
|
|
|
|
249
|
|
|
/** |
250
|
|
|
* Adds as associationConnector |
251
|
|
|
* |
252
|
|
|
* @return self |
253
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TAssociationConnectorType $associationConnector |
254
|
|
|
*/ |
255
|
|
|
public function addToAssociationConnector(TAssociationConnectorType $associationConnector) |
256
|
|
|
{ |
257
|
|
|
$this->associationConnector[] = $associationConnector; |
258
|
|
|
return $this; |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
/** |
262
|
|
|
* isset associationConnector |
263
|
|
|
* |
264
|
|
|
* @param scalar $index |
265
|
|
|
* @return boolean |
266
|
|
|
*/ |
267
|
|
|
public function issetAssociationConnector($index) |
268
|
|
|
{ |
269
|
|
|
return isset($this->associationConnector[$index]); |
270
|
|
|
} |
271
|
|
|
|
272
|
|
|
/** |
273
|
|
|
* unset associationConnector |
274
|
|
|
* |
275
|
|
|
* @param scalar $index |
276
|
|
|
* @return void |
277
|
|
|
*/ |
278
|
|
|
public function unsetAssociationConnector($index) |
279
|
|
|
{ |
280
|
|
|
unset($this->associationConnector[$index]); |
281
|
|
|
} |
282
|
|
|
|
283
|
|
|
/** |
284
|
|
|
* Gets as associationConnector |
285
|
|
|
* |
286
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\edmx\TAssociationConnectorType[] |
287
|
|
|
*/ |
288
|
|
|
public function getAssociationConnector() |
289
|
|
|
{ |
290
|
|
|
return $this->associationConnector; |
291
|
|
|
} |
292
|
|
|
|
293
|
|
|
/** |
294
|
|
|
* Sets a new associationConnector |
295
|
|
|
* |
296
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TAssociationConnectorType[] $associationConnector |
297
|
|
|
* @return self |
298
|
|
|
*/ |
299
|
|
|
public function setAssociationConnector(array $associationConnector) |
300
|
|
|
{ |
301
|
|
|
$this->associationConnector = $associationConnector; |
302
|
|
|
return $this; |
303
|
|
|
} |
304
|
|
|
|
305
|
|
|
/** |
306
|
|
|
* Adds as inheritanceConnector |
307
|
|
|
* |
308
|
|
|
* @return self |
309
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TInheritanceConnectorType $inheritanceConnector |
310
|
|
|
*/ |
311
|
|
|
public function addToInheritanceConnector(TInheritanceConnectorType $inheritanceConnector) |
312
|
|
|
{ |
313
|
|
|
$this->inheritanceConnector[] = $inheritanceConnector; |
314
|
|
|
return $this; |
315
|
|
|
} |
316
|
|
|
|
317
|
|
|
/** |
318
|
|
|
* isset inheritanceConnector |
319
|
|
|
* |
320
|
|
|
* @param scalar $index |
321
|
|
|
* @return boolean |
322
|
|
|
*/ |
323
|
|
|
public function issetInheritanceConnector($index) |
324
|
|
|
{ |
325
|
|
|
return isset($this->inheritanceConnector[$index]); |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
/** |
329
|
|
|
* unset inheritanceConnector |
330
|
|
|
* |
331
|
|
|
* @param scalar $index |
332
|
|
|
* @return void |
333
|
|
|
*/ |
334
|
|
|
public function unsetInheritanceConnector($index) |
335
|
|
|
{ |
336
|
|
|
unset($this->inheritanceConnector[$index]); |
337
|
|
|
} |
338
|
|
|
|
339
|
|
|
/** |
340
|
|
|
* Gets as inheritanceConnector |
341
|
|
|
* |
342
|
|
|
* @return \AlgoWeb\ODataMetadata\MetadataV3\edmx\TInheritanceConnectorType[] |
343
|
|
|
*/ |
344
|
|
|
public function getInheritanceConnector() |
345
|
|
|
{ |
346
|
|
|
return $this->inheritanceConnector; |
347
|
|
|
} |
348
|
|
|
|
349
|
|
|
/** |
350
|
|
|
* Sets a new inheritanceConnector |
351
|
|
|
* |
352
|
|
|
* @param \AlgoWeb\ODataMetadata\MetadataV3\edmx\TInheritanceConnectorType[] $inheritanceConnector |
353
|
|
|
* @return self |
354
|
|
|
*/ |
355
|
|
|
public function setInheritanceConnector(array $inheritanceConnector) |
356
|
|
|
{ |
357
|
|
|
$this->inheritanceConnector = $inheritanceConnector; |
358
|
|
|
return $this; |
359
|
|
|
} |
360
|
|
|
|
361
|
|
|
public function isOK(&$msg = null) |
362
|
|
|
{ |
363
|
|
|
if (!$this->isStringNotNullOrEmpty($this->name)) { |
364
|
|
|
$msg = "Name cannot be null or empty"; |
365
|
|
|
return false; |
366
|
|
|
} |
367
|
|
|
|
368
|
|
|
if (null != $this->diagramId && !$this->isStringNotNullOrEmpty($this->diagramId)) { |
369
|
|
|
$msg = "Diagram ID cannot be empty"; |
370
|
|
|
return false; |
371
|
|
|
} |
372
|
|
|
if (null != $this->zoomLevel && !is_integer($this->zoomLevel)) { |
373
|
|
|
$msg = "Zoom level must be integral"; |
374
|
|
|
return false; |
375
|
|
|
} |
376
|
|
|
if (!$this->isValidArray( |
377
|
|
|
$this->entityTypeShape, |
378
|
|
|
'\AlgoWeb\ODataMetadata\MetadataV3\edmx\TEntityTypeShapeType' |
379
|
|
|
)) { |
380
|
|
|
$msg = "Entity type shape array not a valid array"; |
381
|
|
|
return false; |
382
|
|
|
} |
383
|
|
|
if (!$this->isChildArrayOK($this->entityTypeShape, $msg)) { |
384
|
|
|
return false; |
385
|
|
|
} |
386
|
|
|
if (!$this->isValidArray( |
387
|
|
|
$this->associationConnector, |
388
|
|
|
'\AlgoWeb\ODataMetadata\MetadataV3\edmx\TAssociationConnectorType' |
389
|
|
|
)) { |
390
|
|
|
$msg = "Association connector array not a valid array"; |
391
|
|
|
return false; |
392
|
|
|
} |
393
|
|
|
if (!$this->isChildArrayOK($this->associationConnector, $msg)) { |
394
|
|
|
return false; |
395
|
|
|
} |
396
|
|
|
if (!$this->isValidArray( |
397
|
|
|
$this->inheritanceConnector, |
398
|
|
|
'\AlgoWeb\ODataMetadata\MetadataV3\edmx\TInheritanceConnectorType' |
399
|
|
|
)) { |
400
|
|
|
$msg = "Inheritance connector array not a valid array"; |
401
|
|
|
return false; |
402
|
|
|
} |
403
|
|
|
if (!$this->isChildArrayOK($this->inheritanceConnector, $msg)) { |
404
|
|
|
return false; |
405
|
|
|
} |
406
|
|
|
|
407
|
|
|
return true; |
408
|
|
|
} |
409
|
|
|
} |
410
|
|
|
|