| @@ 333-343 (lines=11) @@ | ||
| 330 | return $tuple; |
|
| 331 | } |
|
| 332 | ||
| 333 | public function getTuple($input) |
|
| 334 | { |
|
| 335 | $output = []; |
|
| 336 | foreach ($this->getProperties() as $index => $name) { |
|
| 337 | if (array_key_exists($name, $input)) { |
|
| 338 | $output[$index] = $this->encodeProperty($name, $input[$name]); |
|
| 339 | } |
|
| 340 | } |
|
| 341 | ||
| 342 | return $output; |
|
| 343 | } |
|
| 344 | ||
| 345 | public function fromTuple($input) |
|
| 346 | { |
|
| @@ 345-355 (lines=11) @@ | ||
| 342 | return $output; |
|
| 343 | } |
|
| 344 | ||
| 345 | public function fromTuple($input) |
|
| 346 | { |
|
| 347 | $output = []; |
|
| 348 | foreach ($this->getProperties() as $index => $name) { |
|
| 349 | if (array_key_exists($index, $input)) { |
|
| 350 | $output[$name] = $this->decodeProperty($name, $input[$index]); |
|
| 351 | } |
|
| 352 | } |
|
| 353 | ||
| 354 | return $output; |
|
| 355 | } |
|
| 356 | ||
| 357 | public function encodeProperty($name, $value) |
|
| 358 | { |
|