1 | <?php |
||
13 | class StructAttribute extends AbstractModel |
||
14 | { |
||
15 | /** |
||
16 | * Type of the struct attribute |
||
17 | * @var string |
||
18 | */ |
||
19 | private $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 | private $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 | private $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 | 1236 | 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 contrusctor array) |
||
50 | * @uses AbstractModel::getCleanName() |
||
51 | * @uses AbstractModel::getName() |
||
52 | * @uses AbstractModel::uniqueName() |
||
53 | * @uses StructAttribute::getOwner() |
||
54 | * @param string $additionnalContext |
||
55 | * @return string |
||
56 | 192 | */ |
|
57 | public function getUniqueName($additionnalContext = '') |
||
61 | /** |
||
62 | * Returns the getter name for this attribute |
||
63 | * @uses StructAttribute::getUniqueName() |
||
64 | * @return string |
||
65 | 186 | */ |
|
66 | public function getGetterName() |
||
70 | /** |
||
71 | * Returns the getter name for this attribute |
||
72 | * @uses StructAttribute::getUniqueName() |
||
73 | * @return string |
||
74 | 186 | */ |
|
75 | public function getSetterName() |
||
79 | /** |
||
80 | * Returns the type value |
||
81 | * @return string |
||
82 | 558 | */ |
|
83 | public function getType() |
||
87 | /** |
||
88 | * Sets the type value |
||
89 | * @param string $type |
||
90 | * @return StructAttribute |
||
91 | 1236 | */ |
|
92 | public function setType($type) |
||
97 | /** |
||
98 | * Returns the type value |
||
99 | * @return bool |
||
100 | 18 | */ |
|
101 | public function getContainsElements() |
||
105 | /** |
||
106 | * Sets the type value |
||
107 | * @param bool $containsElements |
||
108 | * @return StructAttribute |
||
109 | 492 | */ |
|
110 | public function setContainsElements($containsElements) |
||
115 | /** |
||
116 | * @return bool |
||
117 | 204 | */ |
|
118 | public function getRemovableFromRequest() |
||
122 | /** |
||
123 | * @param bool $removableFromRequest |
||
124 | * @return StructAttribute |
||
125 | 486 | */ |
|
126 | public function setRemovableFromRequest($removableFromRequest) |
||
131 | /** |
||
132 | * If this attribute contains elements then it's an array |
||
133 | * only if its parent, the Struct, is not itself an array, |
||
134 | * if the parent is an array, then it is certainly not an array too |
||
135 | * @return bool |
||
136 | 186 | */ |
|
137 | public function isArray() |
||
141 | /** |
||
142 | * Returns potential default value |
||
143 | * @uses AbstractModel::getMetaValueFirstSet() |
||
144 | * @uses Utils::getValueWithinItsType() |
||
145 | * @uses StructAttribute::getType() |
||
146 | * @uses StructAttribute::getContainsElements() |
||
147 | * @return mixed |
||
148 | 186 | */ |
|
149 | public function getDefaultValue() |
||
162 | /** |
||
163 | * Returns true or false depending on minOccurs information associated to the attribute |
||
164 | * @uses AbstractModel::getMetaValueFirstSet() |
||
165 | * @uses AbstractModel::getMetaValue() |
||
166 | * @return bool true|false |
||
167 | 186 | */ |
|
168 | public function isRequired() |
||
177 | /** |
||
178 | * Returns the owner model object, meaning a Struct object |
||
179 | * @see AbstractModel::getOwner() |
||
180 | * @uses AbstractModel::getOwner() |
||
181 | * @return Struct |
||
182 | 198 | */ |
|
183 | public function getOwner() |
||
187 | /** |
||
188 | * @uses StructAttribute::getType() |
||
189 | * @return bool |
||
190 | 186 | */ |
|
191 | public function isXml() |
||
195 | /** |
||
196 | * @return Struct|null |
||
197 | 270 | */ |
|
198 | public function getTypeStruct() |
||
202 | /** |
||
203 | * @return string[] |
||
204 | 222 | */ |
|
205 | public function getTypeStructMeta() |
||
210 | /** |
||
211 | * @return bool |
||
212 | 144 | */ |
|
213 | public function isTypeStructArray() |
||
218 | /** |
||
219 | * @return Struct|null |
||
220 | 222 | */ |
|
221 | public function getInheritanceStruct() |
||
225 | /** |
||
226 | * @return string[] |
||
227 | 222 | */ |
|
228 | public function getInheritanceStructMeta() |
||
233 | /** |
||
234 | * @see \WsdlToPhp\PackageGenerator\Model\AbstractModel::getMeta() |
||
235 | * @return string[] |
||
236 | 222 | */ |
|
237 | public function getMeta() |
||
241 | /** |
||
242 | * @param $filename |
||
243 | * @return StructReservedMethod|StructArrayReservedMethod |
||
244 | 192 | */ |
|
245 | public function getReservedMethodsInstance($filename = null) |
||
249 | /** |
||
250 | * {@inheritDoc} |
||
251 | * @see \WsdlToPhp\PackageGenerator\Model\AbstractModel::toJsonSerialize() |
||
252 | */ |
||
253 | protected function toJsonSerialize() |
||
261 | } |
||
262 |