1 | <?php |
||
11 | class StructAttribute extends AbstractModel |
||
12 | { |
||
13 | /** |
||
14 | * Type of the struct attribute |
||
15 | * @var string |
||
16 | */ |
||
17 | private $type = ''; |
||
18 | /** |
||
19 | * Defines that this property is not a simple value but an array of values |
||
20 | * Infos at {@link https://www.w3.org/TR/xmlschema-0/#OccurrenceConstraints} |
||
21 | * @var bool |
||
22 | */ |
||
23 | private $containsElements = false; |
||
24 | /** |
||
25 | * Defines that this property can be removed from request or not. |
||
26 | * The property cna be removed from the request (meaning from the Struct) as soon as the nillable=true && minOccurs=0 |
||
27 | * Infos at {@link http://www.w3schools.com/xml/el_element.asp} |
||
28 | * @var bool |
||
29 | */ |
||
30 | private $removableFromRequest = false; |
||
31 | /** |
||
32 | * Main constructor |
||
33 | * @see AbstractModel::__construct() |
||
34 | * @uses StructAttribute::setType() |
||
35 | * @uses AbstractModel::setOwner() |
||
36 | * @param Generator $generator |
||
37 | * @param string $name the original name |
||
38 | * @param string $type the type |
||
39 | * @param Struct $struct defines the struct which owns this value |
||
40 | */ |
||
41 | 432 | public function __construct(Generator $generator, $name, $type, Struct $struct) |
|
47 | /** |
||
48 | * Returns the unique name in the current struct (for setters/getters and struct contrusctor array) |
||
49 | * @uses AbstractModel::getCleanName() |
||
50 | * @uses AbstractModel::getName() |
||
51 | * @uses AbstractModel::uniqueName() |
||
52 | * @uses StructAttribute::getOwner() |
||
53 | * @return string |
||
54 | */ |
||
55 | 88 | public function getUniqueName() |
|
59 | /** |
||
60 | * Returns the getter name for this attribute |
||
61 | * @uses StructAttribute::getUniqueName() |
||
62 | * @return string |
||
63 | */ |
||
64 | 84 | public function getGetterName() |
|
68 | /** |
||
69 | * Returns the getter name for this attribute |
||
70 | * @uses StructAttribute::getUniqueName() |
||
71 | * @return string |
||
72 | */ |
||
73 | 84 | public function getSetterName() |
|
77 | /** |
||
78 | * Returns the type value |
||
79 | * @return string |
||
80 | */ |
||
81 | 280 | public function getType() |
|
85 | /** |
||
86 | * Sets the type value |
||
87 | * @param string $type |
||
88 | * @return StructAttribute |
||
89 | */ |
||
90 | 432 | public function setType($type) |
|
95 | /** |
||
96 | * Returns the type value |
||
97 | * @return bool |
||
98 | */ |
||
99 | 12 | public function getContainsElements() |
|
103 | /** |
||
104 | * Sets the type value |
||
105 | * @param bool $containsElements |
||
106 | * @return StructAttribute |
||
107 | */ |
||
108 | 272 | public function setContainsElements($containsElements) |
|
113 | /** |
||
114 | * @return bool |
||
115 | */ |
||
116 | 12 | public function getRemovableFromRequest() |
|
120 | /** |
||
121 | * @param bool $removableFromRequest |
||
122 | * @return StructAttribute |
||
123 | */ |
||
124 | 268 | public function setRemovableFromRequest($removableFromRequest) |
|
129 | /** |
||
130 | * If this attribute contains elements then it's an array |
||
131 | * only if its parent, the Struct, is not itself an array, |
||
132 | * if the parent is an array, then it is certainly not an array too |
||
133 | * @return bool |
||
134 | */ |
||
135 | 84 | public function isArray() |
|
139 | /** |
||
140 | * Returns potential default value |
||
141 | * @uses AbstractModel::getMetaValueFirstSet() |
||
142 | * @uses Utils::getValueWithinItsType() |
||
143 | * @uses StructAttribute::getType() |
||
144 | * @uses StructAttribute::getContainsElements() |
||
145 | * @return mixed |
||
146 | */ |
||
147 | 84 | public function getDefaultValue() |
|
160 | /** |
||
161 | * Returns true or false depending on minOccurs information associated to the attribute |
||
162 | * @uses AbstractModel::getMetaValueFirstSet() |
||
163 | * @uses AbstractModel::getMetaValue() |
||
164 | * @return bool true|false |
||
165 | */ |
||
166 | 84 | public function isRequired() |
|
175 | /** |
||
176 | * Returns the owner model object, meaning a Struct object |
||
177 | * @see AbstractModel::getOwner() |
||
178 | * @uses AbstractModel::getOwner() |
||
179 | * @return Struct |
||
180 | */ |
||
181 | 88 | public function getOwner() |
|
185 | /** |
||
186 | * @uses StructAttribute::getType() |
||
187 | * @return bool |
||
188 | */ |
||
189 | 84 | public function isXml() |
|
193 | /** |
||
194 | * @return Struct|null |
||
195 | */ |
||
196 | 104 | public function getTypeStruct() |
|
200 | /** |
||
201 | * @return string[] |
||
202 | */ |
||
203 | 104 | public function getTypeStructMeta() |
|
208 | /** |
||
209 | * @return Struct|null |
||
210 | */ |
||
211 | 104 | public function getInheritanceStruct() |
|
215 | /** |
||
216 | * @return string[] |
||
217 | */ |
||
218 | 104 | public function getInheritanceStructMeta() |
|
223 | /** |
||
224 | * @see \WsdlToPhp\PackageGenerator\Model\AbstractModel::getMeta() |
||
225 | * @return string[] |
||
226 | */ |
||
227 | 104 | public function getMeta() |
|
231 | } |
||
232 |