1
|
|
|
<?php |
2
|
|
|
namespace Dkd\PhpCmis\DataObjects; |
3
|
|
|
|
4
|
|
|
/** |
5
|
|
|
* This file is part of php-cmis-lib. |
6
|
|
|
* |
7
|
|
|
* (c) Sascha Egerer <[email protected]> |
8
|
|
|
* |
9
|
|
|
* For the full copyright and license information, please view the LICENSE |
10
|
|
|
* file that was distributed with this source code. |
11
|
|
|
*/ |
12
|
|
|
|
13
|
|
|
use Dkd\PhpCmis\Definitions\ChoiceInterface; |
14
|
|
|
use Dkd\PhpCmis\Definitions\MutablePropertyDefinitionInterface; |
15
|
|
|
use Dkd\PhpCmis\Enum\Cardinality; |
16
|
|
|
use Dkd\PhpCmis\Enum\PropertyType; |
17
|
|
|
use Dkd\PhpCmis\Enum\Updatability; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* Abstract property definition data implementation. |
21
|
|
|
*/ |
22
|
|
|
abstract class AbstractPropertyDefinition extends AbstractExtensionData implements MutablePropertyDefinitionInterface |
23
|
|
|
{ |
24
|
|
|
/** |
25
|
|
|
* @var string |
26
|
|
|
*/ |
27
|
|
|
protected $id; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
protected $localName; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var string |
36
|
|
|
*/ |
37
|
|
|
protected $localNamespace; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var string |
41
|
|
|
*/ |
42
|
|
|
protected $queryName; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var string |
46
|
|
|
*/ |
47
|
|
|
protected $displayName; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var string |
51
|
|
|
*/ |
52
|
|
|
protected $description; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var PropertyType |
56
|
|
|
*/ |
57
|
|
|
protected $propertyType; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @var Cardinality |
61
|
|
|
*/ |
62
|
|
|
protected $cardinality; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var ChoiceInterface[] |
66
|
|
|
*/ |
67
|
|
|
protected $choices = array(); |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var array |
71
|
|
|
*/ |
72
|
|
|
protected $defaultValue = array(); |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @var Updatability |
76
|
|
|
*/ |
77
|
|
|
protected $updatability; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @var boolean |
81
|
|
|
*/ |
82
|
|
|
protected $isInherited = false; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @var boolean |
86
|
|
|
*/ |
87
|
|
|
protected $isQueryable = false; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @var boolean |
91
|
|
|
*/ |
92
|
|
|
protected $isOrderable = false; |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @var boolean |
96
|
|
|
*/ |
97
|
|
|
protected $isRequired = false; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @var boolean |
101
|
|
|
*/ |
102
|
|
|
protected $isOpenChoice = false; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param string $id |
106
|
|
|
*/ |
107
|
226 |
|
public function __construct($id) |
108
|
|
|
{ |
109
|
226 |
|
$this->setId($id); |
110
|
226 |
|
} |
111
|
|
|
|
112
|
|
|
/** |
113
|
|
|
* @return string |
114
|
|
|
*/ |
115
|
17 |
|
public function getId() |
116
|
|
|
{ |
117
|
17 |
|
return $this->id; |
118
|
|
|
} |
119
|
|
|
|
120
|
|
|
/** |
121
|
|
|
* @param string $id |
122
|
|
|
*/ |
123
|
226 |
|
public function setId($id) |
124
|
|
|
{ |
125
|
226 |
|
$this->id = $this->castValueToSimpleType('string', $id, true); |
126
|
226 |
|
} |
127
|
|
|
|
128
|
|
|
/** |
129
|
|
|
* @return string |
130
|
|
|
*/ |
131
|
7 |
|
public function getLocalName() |
132
|
|
|
{ |
133
|
7 |
|
return $this->localName; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* @param string $localName |
138
|
|
|
*/ |
139
|
22 |
|
public function setLocalName($localName) |
140
|
|
|
{ |
141
|
22 |
|
$this->localName = $this->castValueToSimpleType('string', $localName, true); |
142
|
22 |
|
} |
143
|
|
|
|
144
|
|
|
/** |
145
|
|
|
* @return string |
146
|
|
|
*/ |
147
|
7 |
|
public function getLocalNamespace() |
148
|
|
|
{ |
149
|
7 |
|
return $this->localNamespace; |
150
|
|
|
} |
151
|
|
|
|
152
|
|
|
/** |
153
|
|
|
* @param string $localNamespace |
154
|
|
|
*/ |
155
|
22 |
|
public function setLocalNamespace($localNamespace) |
156
|
|
|
{ |
157
|
22 |
|
$this->localNamespace = $this->castValueToSimpleType('string', $localNamespace, true); |
158
|
22 |
|
} |
159
|
|
|
|
160
|
|
|
/** |
161
|
|
|
* @return string |
162
|
|
|
*/ |
163
|
16 |
|
public function getQueryName() |
164
|
|
|
{ |
165
|
16 |
|
return $this->queryName; |
166
|
|
|
} |
167
|
|
|
|
168
|
|
|
/** |
169
|
|
|
* @param string $queryName |
170
|
|
|
*/ |
171
|
22 |
|
public function setQueryName($queryName) |
172
|
|
|
{ |
173
|
22 |
|
$this->queryName = $this->castValueToSimpleType('string', $queryName, true); |
174
|
22 |
|
} |
175
|
|
|
|
176
|
|
|
/** |
177
|
|
|
* @return string |
178
|
|
|
*/ |
179
|
7 |
|
public function getDisplayName() |
180
|
|
|
{ |
181
|
7 |
|
return $this->displayName; |
182
|
|
|
} |
183
|
|
|
|
184
|
|
|
/** |
185
|
|
|
* @param string $displayName |
186
|
|
|
*/ |
187
|
22 |
|
public function setDisplayName($displayName) |
188
|
|
|
{ |
189
|
22 |
|
$this->displayName = $this->castValueToSimpleType('string', $displayName, true); |
190
|
22 |
|
} |
191
|
|
|
|
192
|
|
|
/** |
193
|
|
|
* @return string |
194
|
|
|
*/ |
195
|
7 |
|
public function getDescription() |
196
|
|
|
{ |
197
|
7 |
|
return $this->description; |
198
|
|
|
} |
199
|
|
|
|
200
|
|
|
/** |
201
|
|
|
* @param string $description |
202
|
|
|
*/ |
203
|
22 |
|
public function setDescription($description) |
204
|
|
|
{ |
205
|
22 |
|
$this->description = $this->castValueToSimpleType('string', $description, true); |
206
|
22 |
|
} |
207
|
|
|
|
208
|
|
|
/** |
209
|
|
|
* @return PropertyType |
210
|
|
|
*/ |
211
|
1 |
|
public function getPropertyType() |
212
|
|
|
{ |
213
|
1 |
|
return $this->propertyType; |
214
|
|
|
} |
215
|
|
|
|
216
|
|
|
/** |
217
|
|
|
* @param PropertyType $propertyType |
218
|
|
|
*/ |
219
|
10 |
|
public function setPropertyType(PropertyType $propertyType) |
220
|
|
|
{ |
221
|
10 |
|
$this->propertyType = $propertyType; |
222
|
10 |
|
} |
223
|
|
|
|
224
|
|
|
/** |
225
|
|
|
* @return Cardinality |
226
|
|
|
*/ |
227
|
1 |
|
public function getCardinality() |
228
|
|
|
{ |
229
|
1 |
|
return $this->cardinality; |
230
|
|
|
} |
231
|
|
|
|
232
|
|
|
/** |
233
|
|
|
* @param Cardinality $cardinality |
234
|
|
|
*/ |
235
|
10 |
|
public function setCardinality(Cardinality $cardinality) |
236
|
|
|
{ |
237
|
10 |
|
$this->cardinality = $cardinality; |
238
|
10 |
|
} |
239
|
|
|
|
240
|
|
|
/** |
241
|
|
|
* @return ChoiceInterface[] |
242
|
|
|
*/ |
243
|
1 |
|
public function getChoice() |
244
|
|
|
{ |
245
|
1 |
|
return $this->choices; |
246
|
|
|
} |
247
|
|
|
|
248
|
|
|
/** |
249
|
|
|
* @param ChoiceInterface[] $choices |
250
|
|
|
*/ |
251
|
2 |
|
public function setChoice(array $choices) |
252
|
|
|
{ |
253
|
2 |
|
$this->choices = $choices; |
254
|
2 |
|
} |
255
|
|
|
|
256
|
|
|
/** |
257
|
|
|
* @return array |
258
|
|
|
*/ |
259
|
1 |
|
public function getDefaultValue() |
260
|
|
|
{ |
261
|
1 |
|
return $this->defaultValue; |
262
|
|
|
} |
263
|
|
|
|
264
|
|
|
/** |
265
|
|
|
* @param array $defaultValue |
266
|
|
|
*/ |
267
|
2 |
|
public function setDefaultValue(array $defaultValue) |
268
|
|
|
{ |
269
|
2 |
|
$this->defaultValue = $defaultValue; |
270
|
2 |
|
} |
271
|
|
|
|
272
|
|
|
/** |
273
|
|
|
* @return Updatability |
274
|
|
|
*/ |
275
|
1 |
|
public function getUpdatability() |
276
|
|
|
{ |
277
|
1 |
|
return $this->updatability; |
278
|
|
|
} |
279
|
|
|
|
280
|
|
|
/** |
281
|
|
|
* @param Updatability $updatability |
282
|
|
|
*/ |
283
|
10 |
|
public function setUpdatability(Updatability $updatability) |
284
|
|
|
{ |
285
|
10 |
|
$this->updatability = $updatability; |
286
|
10 |
|
} |
287
|
|
|
|
288
|
|
|
/** |
289
|
|
|
* @return boolean |
290
|
|
|
*/ |
291
|
8 |
|
public function isInherited() |
292
|
|
|
{ |
293
|
8 |
|
return $this->isInherited; |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
/** |
297
|
|
|
* @param boolean $isInherited |
298
|
|
|
*/ |
299
|
24 |
|
public function setIsInherited($isInherited) |
300
|
|
|
{ |
301
|
24 |
|
$this->isInherited = $this->castValueToSimpleType('boolean', $isInherited); |
302
|
24 |
|
} |
303
|
|
|
|
304
|
|
|
/** |
305
|
|
|
* @return boolean |
306
|
|
|
*/ |
307
|
8 |
|
public function isQueryable() |
308
|
|
|
{ |
309
|
8 |
|
return $this->isQueryable; |
310
|
|
|
} |
311
|
|
|
|
312
|
|
|
/** |
313
|
|
|
* @param boolean $isQueryable |
314
|
|
|
*/ |
315
|
24 |
|
public function setIsQueryable($isQueryable) |
316
|
|
|
{ |
317
|
24 |
|
$this->isQueryable = $this->castValueToSimpleType('boolean', $isQueryable); |
318
|
24 |
|
} |
319
|
|
|
|
320
|
|
|
/** |
321
|
|
|
* @return boolean |
322
|
|
|
*/ |
323
|
8 |
|
public function isOrderable() |
324
|
|
|
{ |
325
|
8 |
|
return $this->isOrderable; |
326
|
|
|
} |
327
|
|
|
|
328
|
|
|
/** |
329
|
|
|
* @param boolean $isOrderable |
330
|
|
|
*/ |
331
|
24 |
|
public function setIsOrderable($isOrderable) |
332
|
|
|
{ |
333
|
24 |
|
$this->isOrderable = $this->castValueToSimpleType('boolean', $isOrderable); |
334
|
24 |
|
} |
335
|
|
|
|
336
|
|
|
/** |
337
|
|
|
* @return boolean |
338
|
|
|
*/ |
339
|
8 |
|
public function isRequired() |
340
|
|
|
{ |
341
|
8 |
|
return $this->isRequired; |
342
|
|
|
} |
343
|
|
|
|
344
|
|
|
/** |
345
|
|
|
* @param boolean $isRequired |
346
|
|
|
*/ |
347
|
24 |
|
public function setIsRequired($isRequired) |
348
|
|
|
{ |
349
|
24 |
|
$this->isRequired = $this->castValueToSimpleType('boolean', $isRequired); |
350
|
24 |
|
} |
351
|
|
|
|
352
|
|
|
/** |
353
|
|
|
* @return boolean |
354
|
|
|
*/ |
355
|
8 |
|
public function isOpenChoice() |
356
|
|
|
{ |
357
|
8 |
|
return $this->isOpenChoice; |
358
|
|
|
} |
359
|
|
|
|
360
|
|
|
/** |
361
|
|
|
* @param boolean $isOpenChoice |
362
|
|
|
*/ |
363
|
24 |
|
public function setIsOpenChoice($isOpenChoice) |
364
|
|
|
{ |
365
|
24 |
|
$this->isOpenChoice = $this->castValueToSimpleType('boolean', $isOpenChoice); |
366
|
24 |
|
} |
367
|
|
|
} |
368
|
|
|
|