1 | <?php |
||
13 | class StructAttribute extends AbstractModel |
||
14 | { |
||
15 | /** |
||
16 | * Type of the struct attribute |
||
17 | * @var string |
||
18 | */ |
||
19 | protected $type = ''; |
||
20 | /** |
||
21 | * Defines that this property is not a simple value but an array of values |
||
22 | * Infos at {@link https://www.w3.org/TR/xmlschema-0/#OccurrenceConstraints} |
||
23 | * @var bool |
||
24 | */ |
||
25 | protected $containsElements = false; |
||
26 | /** |
||
27 | * Defines that this property can be removed from request or not. |
||
28 | * The property cna be removed from the request (meaning from the Struct) as soon as the nillable=true && minOccurs=0 |
||
29 | * Infos at {@link http://www.w3schools.com/xml/el_element.asp} |
||
30 | * @var bool |
||
31 | */ |
||
32 | protected $removableFromRequest = false; |
||
33 | /** |
||
34 | * Main constructor |
||
35 | * @see AbstractModel::__construct() |
||
36 | * @uses StructAttribute::setType() |
||
37 | * @uses AbstractModel::setOwner() |
||
38 | * @param Generator $generator |
||
39 | * @param string $name the original name |
||
40 | * @param string $type the type |
||
41 | * @param Struct $struct defines the struct which owns this value |
||
42 | */ |
||
43 | 1145 | public function __construct(Generator $generator, $name, $type = '', Struct $struct = null) |
|
48 | /** |
||
49 | * Returns the unique name in the current struct (for setters/getters and struct constructor array) |
||
50 | * @uses AbstractModel::getCleanName() |
||
51 | * @uses AbstractModel::getName() |
||
52 | * @uses AbstractModel::uniqueName() |
||
53 | * @uses StructAttribute::getOwner() |
||
54 | * @param string $additionalContext |
||
55 | * @param string $string |
||
56 | * @param string $additionalContext |
||
57 | * @return string |
||
58 | */ |
||
59 | 170 | public function getUniqueString($string, $additionalContext= '') |
|
63 | /** |
||
64 | * Returns the unique name in the current struct (for setters/getters and struct contrusctor array) |
||
65 | * @uses AbstractModel::getCleanName() |
||
66 | * @uses AbstractModel::getName() |
||
67 | * @uses AbstractModel::uniqueName() |
||
68 | * @uses StructAttribute::getOwner() |
||
69 | * @param string $additionalContext |
||
70 | * @return string |
||
71 | */ |
||
72 | 170 | public function getUniqueName($additionalContext = '') |
|
76 | /** |
||
77 | * Returns the getter name for this attribute |
||
78 | * @uses StructAttribute::getUniqueName() |
||
79 | * @return string |
||
80 | */ |
||
81 | 165 | public function getGetterName() |
|
85 | /** |
||
86 | * Returns the getter name for this attribute |
||
87 | * @uses StructAttribute::getUniqueName() |
||
88 | * @return string |
||
89 | */ |
||
90 | 165 | public function getSetterName() |
|
94 | /** |
||
95 | * Returns the type value |
||
96 | * @return string |
||
97 | */ |
||
98 | 280 | public function getType() |
|
102 | /** |
||
103 | * Sets the type value |
||
104 | * @param string $type |
||
105 | * @return StructAttribute |
||
106 | */ |
||
107 | 1145 | public function setType($type) |
|
112 | /** |
||
113 | * Returns the type value |
||
114 | * @return bool |
||
115 | */ |
||
116 | 15 | public function getContainsElements() |
|
120 | /** |
||
121 | * Sets the type value |
||
122 | * @param bool $containsElements |
||
123 | * @return StructAttribute |
||
124 | */ |
||
125 | 440 | public function setContainsElements($containsElements) |
|
130 | /** |
||
131 | * @return bool |
||
132 | */ |
||
133 | 175 | public function getRemovableFromRequest() |
|
137 | /** |
||
138 | * @param bool $removableFromRequest |
||
139 | * @return StructAttribute |
||
140 | */ |
||
141 | 435 | public function setRemovableFromRequest($removableFromRequest) |
|
146 | /** |
||
147 | * If this attribute contains elements then it's an array |
||
148 | * only if its parent, the Struct, is not itself an array, |
||
149 | * if the parent is an array, then it is certainly not an array too |
||
150 | * @return bool |
||
151 | */ |
||
152 | 190 | public function isArray() |
|
156 | /** |
||
157 | * Returns potential default value |
||
158 | * @uses AbstractModel::getMetaValueFirstSet() |
||
159 | * @uses Utils::getValueWithinItsType() |
||
160 | * @uses StructAttribute::getType() |
||
161 | * @uses StructAttribute::getContainsElements() |
||
162 | * @return mixed |
||
163 | */ |
||
164 | 160 | public function getDefaultValue() |
|
177 | /** |
||
178 | * Returns true or false depending on minOccurs information associated to the attribute |
||
179 | * @uses AbstractModel::getMetaValueFirstSet() |
||
180 | * @uses AbstractModel::getMetaValue() |
||
181 | * @return bool true|false |
||
182 | */ |
||
183 | 160 | public function isRequired() |
|
192 | /** |
||
193 | * Returns the owner model object, meaning a Struct object |
||
194 | * @see AbstractModel::getOwner() |
||
195 | * @uses AbstractModel::getOwner() |
||
196 | * @return Struct |
||
197 | */ |
||
198 | 175 | public function getOwner() |
|
202 | /** |
||
203 | * @uses StructAttribute::getType() |
||
204 | * @return bool |
||
205 | */ |
||
206 | 160 | public function isXml() |
|
210 | /** |
||
211 | * @return Struct|null |
||
212 | */ |
||
213 | 260 | public function getTypeStruct() |
|
217 | /** |
||
218 | * @return string[] |
||
219 | */ |
||
220 | 220 | public function getTypeStructMeta() |
|
225 | /** |
||
226 | * @return bool |
||
227 | */ |
||
228 | 155 | public function isTypeStructArray() |
|
233 | /** |
||
234 | * @return Struct|null |
||
235 | */ |
||
236 | 220 | public function getInheritanceStruct() |
|
240 | /** |
||
241 | * @return string[] |
||
242 | */ |
||
243 | 220 | public function getInheritanceStructMeta() |
|
248 | /** |
||
249 | * @see \WsdlToPhp\PackageGenerator\Model\AbstractModel::getMeta() |
||
250 | * @return string[] |
||
251 | */ |
||
252 | 220 | public function getMeta() |
|
256 | /** |
||
257 | * @param $filename |
||
258 | * @return StructReservedMethod|StructArrayReservedMethod |
||
259 | */ |
||
260 | 170 | public function getReservedMethodsInstance($filename = null) |
|
264 | /** |
||
265 | * {@inheritDoc} |
||
266 | * @see \WsdlToPhp\PackageGenerator\Model\AbstractModel::toJsonSerialize() |
||
267 | */ |
||
268 | 5 | protected function toJsonSerialize() |
|
276 | } |
||
277 |