1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AlgoWeb\ODataMetadata\MetadataV3\edmx; |
4
|
|
|
|
5
|
|
|
use AlgoWeb\ODataMetadata\IsOK; |
6
|
|
|
|
7
|
|
|
/** |
8
|
|
|
* Class representing TEntityTypeShapeType |
9
|
|
|
* |
10
|
|
|
* |
11
|
|
|
* XSD Type: TEntityTypeShape |
12
|
|
|
*/ |
13
|
|
|
class TEntityTypeShapeType extends IsOK |
14
|
|
|
{ |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @property string $entityType |
18
|
|
|
*/ |
19
|
|
|
private $entityType = null; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* @property float $pointX |
23
|
|
|
*/ |
24
|
|
|
private $pointX = null; |
25
|
|
|
|
26
|
|
|
/** |
27
|
|
|
* @property float $pointY |
28
|
|
|
*/ |
29
|
|
|
private $pointY = null; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @property float $width |
33
|
|
|
*/ |
34
|
|
|
private $width = null; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @property float $height |
38
|
|
|
*/ |
39
|
|
|
private $height = null; |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @property boolean $isExpanded |
43
|
|
|
*/ |
44
|
|
|
private $isExpanded = null; |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @property string $fillColor |
48
|
|
|
*/ |
49
|
|
|
private $fillColor = null; |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* Gets as entityType |
53
|
|
|
* |
54
|
|
|
* @return string |
55
|
|
|
*/ |
56
|
|
|
public function getEntityType() |
57
|
|
|
{ |
58
|
|
|
return $this->entityType; |
59
|
|
|
} |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Sets a new entityType |
63
|
|
|
* |
64
|
|
|
* @param string $entityType |
65
|
|
|
* @return self |
66
|
|
|
*/ |
67
|
|
|
public function setEntityType($entityType) |
68
|
|
|
{ |
69
|
|
|
if (!$this->isStringNotNullOrEmpty($this->entityType)) { |
70
|
|
|
$msg = "Entity type cannot be null or empty"; |
71
|
|
|
throw new \InvalidArgumentException($msg); |
72
|
|
|
} |
73
|
|
|
$this->entityType = $entityType; |
74
|
|
|
return $this; |
75
|
|
|
} |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Gets as pointX |
79
|
|
|
* |
80
|
|
|
* @return float |
81
|
|
|
*/ |
82
|
|
|
public function getPointX() |
83
|
|
|
{ |
84
|
|
|
return $this->pointX; |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Sets a new pointX |
89
|
|
|
* |
90
|
|
|
* @param float $pointX |
91
|
|
|
* @return self |
92
|
|
|
*/ |
93
|
|
View Code Duplication |
public function setPointX($pointX) |
|
|
|
|
94
|
|
|
{ |
95
|
|
|
if (null != $pointX && !is_numeric($pointX)) { |
96
|
|
|
$msg = "Point X value must be numeric"; |
97
|
|
|
throw new \InvalidArgumentException($msg); |
98
|
|
|
} |
99
|
|
|
$this->pointX = $pointX; |
100
|
|
|
return $this; |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* Gets as pointY |
105
|
|
|
* |
106
|
|
|
* @return float |
107
|
|
|
*/ |
108
|
|
|
public function getPointY() |
109
|
|
|
{ |
110
|
|
|
return $this->pointY; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* Sets a new pointY |
115
|
|
|
* |
116
|
|
|
* @param float $pointY |
117
|
|
|
* @return self |
118
|
|
|
*/ |
119
|
|
View Code Duplication |
public function setPointY($pointY) |
|
|
|
|
120
|
|
|
{ |
121
|
|
|
if (null != $pointY && !is_numeric($pointY)) { |
122
|
|
|
$msg = "Point Y value must be numeric"; |
123
|
|
|
throw new \InvalidArgumentException($msg); |
124
|
|
|
} |
125
|
|
|
$this->pointY = $pointY; |
126
|
|
|
return $this; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* Gets as width |
131
|
|
|
* |
132
|
|
|
* @return float |
133
|
|
|
*/ |
134
|
|
|
public function getWidth() |
135
|
|
|
{ |
136
|
|
|
return $this->width; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* Sets a new width |
141
|
|
|
* |
142
|
|
|
* @param float $width |
143
|
|
|
* @return self |
144
|
|
|
*/ |
145
|
|
View Code Duplication |
public function setWidth($width) |
|
|
|
|
146
|
|
|
{ |
147
|
|
|
if (null != $width && (!is_numeric($width) || 0 >= $width)) { |
148
|
|
|
$msg = "Width value must be numeric and positive"; |
149
|
|
|
throw new \InvalidArgumentException($msg); |
150
|
|
|
} |
151
|
|
|
$this->width = $width; |
152
|
|
|
return $this; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* Gets as height |
157
|
|
|
* |
158
|
|
|
* @return float |
159
|
|
|
*/ |
160
|
|
|
public function getHeight() |
161
|
|
|
{ |
162
|
|
|
return $this->height; |
163
|
|
|
} |
164
|
|
|
|
165
|
|
|
/** |
166
|
|
|
* Sets a new height |
167
|
|
|
* |
168
|
|
|
* @param float $height |
169
|
|
|
* @return self |
170
|
|
|
*/ |
171
|
|
View Code Duplication |
public function setHeight($height) |
|
|
|
|
172
|
|
|
{ |
173
|
|
|
if (null != $height && (!is_numeric($height) || 0 >= $height)) { |
174
|
|
|
$msg = "Height value must be numeric and positive"; |
175
|
|
|
throw new \InvalidArgumentException($msg); |
176
|
|
|
} |
177
|
|
|
$this->height = $height; |
178
|
|
|
return $this; |
179
|
|
|
} |
180
|
|
|
|
181
|
|
|
/** |
182
|
|
|
* Gets as isExpanded |
183
|
|
|
* |
184
|
|
|
* @return boolean |
185
|
|
|
*/ |
186
|
|
|
public function getIsExpanded() |
187
|
|
|
{ |
188
|
|
|
return $this->isExpanded; |
189
|
|
|
} |
190
|
|
|
|
191
|
|
|
/** |
192
|
|
|
* Sets a new isExpanded |
193
|
|
|
* |
194
|
|
|
* @param boolean $isExpanded |
195
|
|
|
* @return self |
196
|
|
|
*/ |
197
|
|
|
public function setIsExpanded($isExpanded) |
198
|
|
|
{ |
199
|
|
|
$this->isExpanded = $isExpanded; |
200
|
|
|
return $this; |
201
|
|
|
} |
202
|
|
|
|
203
|
|
|
/** |
204
|
|
|
* Gets as fillColor |
205
|
|
|
* |
206
|
|
|
* @return string |
207
|
|
|
*/ |
208
|
|
|
public function getFillColor() |
209
|
|
|
{ |
210
|
|
|
return $this->fillColor; |
211
|
|
|
} |
212
|
|
|
|
213
|
|
|
/** |
214
|
|
|
* Sets a new fillColor |
215
|
|
|
* |
216
|
|
|
* @param string $fillColor |
217
|
|
|
* @return self |
218
|
|
|
*/ |
219
|
|
|
public function setFillColor($fillColor) |
220
|
|
|
{ |
221
|
|
|
if (null != $fillColor && !$this->isStringNotNullOrEmpty($fillColor)) { |
222
|
|
|
$msg = "Fill color cannot be null or empty"; |
|
|
|
|
223
|
|
|
return false; |
|
|
|
|
224
|
|
|
} |
225
|
|
|
$this->fillColor = $fillColor; |
226
|
|
|
return $this; |
227
|
|
|
} |
228
|
|
|
|
229
|
|
|
/** |
230
|
|
|
* @return bool |
231
|
|
|
*/ |
232
|
|
|
public function isOK(&$msg = null) |
233
|
|
|
{ |
234
|
|
|
if (!$this->isStringNotNullOrEmpty($this->entityType)) { |
235
|
|
|
$msg = "Entity type cannot be null or empty"; |
236
|
|
|
return false; |
237
|
|
|
} |
238
|
|
|
|
239
|
|
|
if (null != $this->fillColor && !$this->isStringNotNullOrEmpty($this->fillColor)) { |
240
|
|
|
$msg = "Fill color cannot be empty"; |
241
|
|
|
return false; |
242
|
|
|
} |
243
|
|
|
|
244
|
|
View Code Duplication |
if (null != $this->pointX && !is_numeric($this->pointX)) { |
|
|
|
|
245
|
|
|
$msg = "Point X value must be numeric"; |
246
|
|
|
return false; |
247
|
|
|
} |
248
|
|
View Code Duplication |
if (null != $this->pointY && !is_numeric($this->pointY)) { |
|
|
|
|
249
|
|
|
$msg = "Point Y value must be numeric"; |
250
|
|
|
return false; |
251
|
|
|
} |
252
|
|
|
if (null != $this->width && (!is_numeric($this->width) || 0 >= $this->width)) { |
253
|
|
|
$msg = "Width value must be numeric and positive"; |
254
|
|
|
return false; |
255
|
|
|
} |
256
|
|
|
if (null != $this->height && (!is_numeric($this->height) || 0 >= $this->height)) { |
257
|
|
|
$msg = "Height value must be numeric and positive"; |
258
|
|
|
return false; |
259
|
|
|
} |
260
|
|
|
|
261
|
|
|
return true; |
262
|
|
|
} |
263
|
|
|
} |
264
|
|
|
|
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.