1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace AlgoWeb\ODataMetadata\MetadataV3\edm\ssdl; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class representing TEntityTypeType |
7
|
|
|
* |
8
|
|
|
* |
9
|
|
|
* XSD Type: TEntityType |
10
|
|
|
*/ |
11
|
|
View Code Duplication |
class TEntityTypeType |
|
|
|
|
12
|
|
|
{ |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @property string $name |
16
|
|
|
*/ |
17
|
|
|
private $name = null; |
18
|
|
|
|
19
|
|
|
/** |
20
|
|
|
* @property \MetadataV3\edm\ssdl\TDocumentationType $documentation |
21
|
|
|
*/ |
22
|
|
|
private $documentation = null; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* @property \MetadataV3\edm\ssdl\TPropertyRefType[] $key |
26
|
|
|
*/ |
27
|
|
|
private $key = null; |
28
|
|
|
|
29
|
|
|
/** |
30
|
|
|
* @property \MetadataV3\edm\ssdl\TEntityPropertyType[] $property |
31
|
|
|
*/ |
32
|
|
|
private $property = array( |
33
|
|
|
|
34
|
|
|
); |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Gets as name |
38
|
|
|
* |
39
|
|
|
* @return string |
40
|
|
|
*/ |
41
|
|
|
public function getName() |
42
|
|
|
{ |
43
|
|
|
return $this->name; |
44
|
|
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* Sets a new name |
48
|
|
|
* |
49
|
|
|
* @param string $name |
50
|
|
|
* @return self |
51
|
|
|
*/ |
52
|
|
|
public function setName($name) |
53
|
|
|
{ |
54
|
|
|
$this->name = $name; |
55
|
|
|
return $this; |
56
|
|
|
} |
57
|
|
|
|
58
|
|
|
/** |
59
|
|
|
* Gets as documentation |
60
|
|
|
* |
61
|
|
|
* @return \MetadataV3\edm\ssdl\TDocumentationType |
62
|
|
|
*/ |
63
|
|
|
public function getDocumentation() |
64
|
|
|
{ |
65
|
|
|
return $this->documentation; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Sets a new documentation |
70
|
|
|
* |
71
|
|
|
* @param \MetadataV3\edm\ssdl\TDocumentationType $documentation |
72
|
|
|
* @return self |
73
|
|
|
*/ |
74
|
|
|
public function setDocumentation(\MetadataV3\edm\ssdl\TDocumentationType $documentation) |
75
|
|
|
{ |
76
|
|
|
$this->documentation = $documentation; |
77
|
|
|
return $this; |
78
|
|
|
} |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* Adds as propertyRef |
82
|
|
|
* |
83
|
|
|
* @return self |
84
|
|
|
* @param \MetadataV3\edm\ssdl\TPropertyRefType $propertyRef |
85
|
|
|
*/ |
86
|
|
|
public function addToKey(\MetadataV3\edm\ssdl\TPropertyRefType $propertyRef) |
87
|
|
|
{ |
88
|
|
|
$this->key[] = $propertyRef; |
89
|
|
|
return $this; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* isset key |
94
|
|
|
* |
95
|
|
|
* @param scalar $index |
96
|
|
|
* @return boolean |
97
|
|
|
*/ |
98
|
|
|
public function issetKey($index) |
99
|
|
|
{ |
100
|
|
|
return isset($this->key[$index]); |
101
|
|
|
} |
102
|
|
|
|
103
|
|
|
/** |
104
|
|
|
* unset key |
105
|
|
|
* |
106
|
|
|
* @param scalar $index |
107
|
|
|
* @return void |
108
|
|
|
*/ |
109
|
|
|
public function unsetKey($index) |
110
|
|
|
{ |
111
|
|
|
unset($this->key[$index]); |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* Gets as key |
116
|
|
|
* |
117
|
|
|
* @return \MetadataV3\edm\ssdl\TPropertyRefType[] |
118
|
|
|
*/ |
119
|
|
|
public function getKey() |
120
|
|
|
{ |
121
|
|
|
return $this->key; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* Sets a new key |
126
|
|
|
* |
127
|
|
|
* @param \MetadataV3\edm\ssdl\TPropertyRefType[] $key |
128
|
|
|
* @return self |
129
|
|
|
*/ |
130
|
|
|
public function setKey(array $key) |
131
|
|
|
{ |
132
|
|
|
$this->key = $key; |
133
|
|
|
return $this; |
134
|
|
|
} |
135
|
|
|
|
136
|
|
|
/** |
137
|
|
|
* Adds as property |
138
|
|
|
* |
139
|
|
|
* @return self |
140
|
|
|
* @param \MetadataV3\edm\ssdl\TEntityPropertyType $property |
141
|
|
|
*/ |
142
|
|
|
public function addToProperty(\MetadataV3\edm\ssdl\TEntityPropertyType $property) |
143
|
|
|
{ |
144
|
|
|
$this->property[] = $property; |
145
|
|
|
return $this; |
146
|
|
|
} |
147
|
|
|
|
148
|
|
|
/** |
149
|
|
|
* isset property |
150
|
|
|
* |
151
|
|
|
* @param scalar $index |
152
|
|
|
* @return boolean |
153
|
|
|
*/ |
154
|
|
|
public function issetProperty($index) |
155
|
|
|
{ |
156
|
|
|
return isset($this->property[$index]); |
157
|
|
|
} |
158
|
|
|
|
159
|
|
|
/** |
160
|
|
|
* unset property |
161
|
|
|
* |
162
|
|
|
* @param scalar $index |
163
|
|
|
* @return void |
164
|
|
|
*/ |
165
|
|
|
public function unsetProperty($index) |
166
|
|
|
{ |
167
|
|
|
unset($this->property[$index]); |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* Gets as property |
172
|
|
|
* |
173
|
|
|
* @return \MetadataV3\edm\ssdl\TEntityPropertyType[] |
174
|
|
|
*/ |
175
|
|
|
public function getProperty() |
176
|
|
|
{ |
177
|
|
|
return $this->property; |
178
|
|
|
} |
179
|
|
|
|
180
|
|
|
/** |
181
|
|
|
* Sets a new property |
182
|
|
|
* |
183
|
|
|
* @param \MetadataV3\edm\ssdl\TEntityPropertyType[] $property |
184
|
|
|
* @return self |
185
|
|
|
*/ |
186
|
|
|
public function setProperty(array $property) |
187
|
|
|
{ |
188
|
|
|
$this->property = $property; |
189
|
|
|
return $this; |
190
|
|
|
} |
191
|
|
|
} |
192
|
|
|
|
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.