| @@ 341-351 (lines=11) @@ | ||
| 338 | return $tuple; |
|
| 339 | } |
|
| 340 | ||
| 341 | public function getTuple($input) |
|
| 342 | { |
|
| 343 | $output = []; |
|
| 344 | foreach ($this->getProperties() as $index => $name) { |
|
| 345 | if (array_key_exists($name, $input)) { |
|
| 346 | $output[$index] = $this->encodeProperty($name, $input[$name]); |
|
| 347 | } |
|
| 348 | } |
|
| 349 | ||
| 350 | return $output; |
|
| 351 | } |
|
| 352 | ||
| 353 | public function fromTuple($input) |
|
| 354 | { |
|
| @@ 353-363 (lines=11) @@ | ||
| 350 | return $output; |
|
| 351 | } |
|
| 352 | ||
| 353 | public function fromTuple($input) |
|
| 354 | { |
|
| 355 | $output = []; |
|
| 356 | foreach ($this->getProperties() as $index => $name) { |
|
| 357 | if (array_key_exists($index, $input)) { |
|
| 358 | $output[$name] = $this->decodeProperty($name, $input[$index]); |
|
| 359 | } |
|
| 360 | } |
|
| 361 | ||
| 362 | return $output; |
|
| 363 | } |
|
| 364 | ||
| 365 | public function encodeProperty($name, $value) |
|
| 366 | { |
|