1 | <?php |
||
12 | class StructArray extends Struct |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | const METHOD_GET_ATTRIBUTE_NAME = 'getAttributeName'; |
||
18 | /** |
||
19 | * @var string |
||
20 | */ |
||
21 | const METHOD_CURRENT = 'current'; |
||
22 | /** |
||
23 | * @var string |
||
24 | */ |
||
25 | const METHOD_ITEM = 'item'; |
||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | const METHOD_FIRST = 'first'; |
||
30 | /** |
||
31 | * @var string |
||
32 | */ |
||
33 | const METHOD_LAST = 'last'; |
||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | const METHOD_OFFSET_GET = 'offsetGet'; |
||
38 | /** |
||
39 | * @var string |
||
40 | */ |
||
41 | const METHOD_ADD = 'add'; |
||
42 | /** |
||
43 | * @see \WsdlToPhp\PackageGenerator\File\Struct::addStructMethodsSetAndGet() |
||
44 | */ |
||
45 | public function addStructMethodsSetAndGet(MethodContainer $methods) |
||
46 | { |
||
47 | parent::addStructMethodsSetAndGet($methods); |
||
48 | $this |
||
49 | ->addArrayMethodCurrent($methods) |
||
50 | ->addArrayMethodItem($methods) |
||
51 | ->addArrayMethodFirst($methods) |
||
52 | ->addArrayMethodLast($methods) |
||
53 | ->addArrayMethodOffsetGet($methods) |
||
54 | ->addArrayMethodAdd($methods) |
||
55 | 28 | ->addArrayMethodGetAttributeName($methods); |
|
56 | return $this; |
||
57 | 28 | } |
|
58 | /** |
||
59 | * @param MethodContainer $methods |
||
60 | * @return StructArray |
||
61 | */ |
||
62 | protected function addArrayMethodCurrent(MethodContainer $methods) |
||
63 | { |
||
64 | 28 | return $this->addArrayMethodGenericMethod($methods, self::METHOD_CURRENT, $this->getArrayMethodBody(self::METHOD_CURRENT)); |
|
65 | } |
||
66 | 28 | /** |
|
67 | * @param MethodContainer $methods |
||
68 | * @return StructArray |
||
69 | */ |
||
70 | protected function addArrayMethodItem(MethodContainer $methods) |
||
71 | { |
||
72 | return $this->addArrayMethodGenericMethod($methods, self::METHOD_ITEM, $this->getArrayMethodBody(self::METHOD_ITEM, '$index'), array( |
||
73 | 'index', |
||
74 | 28 | )); |
|
75 | } |
||
76 | 28 | /** |
|
77 | 28 | * @param MethodContainer $methods |
|
78 | 21 | * @return StructArray |
|
79 | 28 | */ |
|
80 | 28 | protected function addArrayMethodFirst(MethodContainer $methods) |
|
84 | /** |
||
85 | * @param MethodContainer $methods |
||
86 | * @return StructArray |
||
87 | */ |
||
88 | protected function addArrayMethodLast(MethodContainer $methods) |
||
92 | 28 | /** |
|
93 | 28 | * @param MethodContainer $methods |
|
94 | * @return StructArray |
||
95 | 28 | */ |
|
96 | protected function addArrayMethodOffsetGet(MethodContainer $methods) |
||
102 | /** |
||
103 | 28 | * @param MethodContainer $methods |
|
104 | * @return StructArray |
||
105 | 28 | */ |
|
106 | protected function addArrayMethodGetAttributeName(MethodContainer $methods) |
||
110 | /** |
||
111 | * @param MethodContainer $methods |
||
112 | * @return StructArray |
||
113 | */ |
||
114 | 28 | protected function addArrayMethodAdd(MethodContainer $methods) |
|
126 | 28 | /** |
|
127 | * @param MethodContainer $methods |
||
128 | * @param string $name |
||
129 | * @param string $body |
||
130 | * @param string[] $methodParameters |
||
131 | 28 | * @return StructArray |
|
132 | */ |
||
133 | 28 | protected function addArrayMethodGenericMethod(MethodContainer $methods, $name, $body, array $methodParameters = array()) |
|
140 | 28 | /** |
|
141 | 28 | * @return PhpAnnotationBlock |
|
142 | 28 | */ |
|
143 | protected function getArrayMethodGetAttributeNameAnnotationBlock() |
||
151 | /** |
||
152 | * @return PhpAnnotationBlock |
||
153 | */ |
||
154 | protected function getArrayMethodCurrentAnnotationBlock() |
||
158 | 28 | /** |
|
159 | 28 | * @return PhpAnnotationBlock |
|
160 | 21 | */ |
|
161 | protected function getArrayMethodFirstAnnotationBlock() |
||
165 | /** |
||
166 | 28 | * @return PhpAnnotationBlock |
|
167 | */ |
||
168 | 28 | protected function getArrayMethodLastAnnotationBlock() |
|
172 | /** |
||
173 | * @return PhpAnnotationBlock |
||
174 | 28 | */ |
|
175 | protected function getArrayMethodItemAnnotationBlock() |
||
179 | /** |
||
180 | * @return PhpAnnotationBlock |
||
181 | */ |
||
182 | 28 | protected function getArrayMethodOffsetGetAnnotationBlock() |
|
186 | 21 | /** |
|
187 | * @return PhpAnnotationBlock |
||
188 | */ |
||
189 | protected function getArrayMethodAddAnnotationBlock() |
||
200 | 28 | /** |
|
201 | * @param string $name |
||
202 | 28 | * @param string $description |
|
203 | 12 | * @param string $param |
|
204 | 12 | * @return PhpAnnotationBlock |
|
205 | 9 | */ |
|
206 | protected function getArrayMethodGenericAnnotationBlock($name, $description, $param = null) |
||
218 | 28 | /** |
|
219 | 28 | * @param PhpMethod $method |
|
220 | 28 | * @return PhpAnnotationBlock|null |
|
221 | 28 | */ |
|
222 | protected function getStructMethodAnnotationBlock(PhpMethod $method) |
||
258 | 28 | /** |
|
259 | * @param string $method |
||
260 | 28 | * @param string $var |
|
261 | * @return string |
||
262 | */ |
||
263 | protected function getArrayMethodBody($method, $var = '') |
||
267 | 28 | /** |
|
268 | * @see \WsdlToPhp\PackageGenerator\File\AbstractModelFile::setModel() |
||
269 | * @throws \InvalidaArgumentException |
||
270 | * @param AbstractModel $model |
||
271 | * @return StructArray |
||
272 | 12 | */ |
|
273 | public function setModel(AbstractModel $model) |
||
280 | } |
||
281 |