| @@ 396-406 (lines=11) @@ | ||
| 393 | return $tuple; |
|
| 394 | } |
|
| 395 | ||
| 396 | public function getTuple($input) |
|
| 397 | { |
|
| 398 | $output = []; |
|
| 399 | foreach ($this->getProperties() as $index => $name) { |
|
| 400 | if (array_key_exists($name, $input)) { |
|
| 401 | $output[$index] = $this->encodeProperty($name, $input[$name]); |
|
| 402 | } |
|
| 403 | } |
|
| 404 | ||
| 405 | return $output; |
|
| 406 | } |
|
| 407 | ||
| 408 | public function fromTuple($input) |
|
| 409 | { |
|
| @@ 408-418 (lines=11) @@ | ||
| 405 | return $output; |
|
| 406 | } |
|
| 407 | ||
| 408 | public function fromTuple($input) |
|
| 409 | { |
|
| 410 | $output = []; |
|
| 411 | foreach ($this->getProperties() as $index => $name) { |
|
| 412 | if (array_key_exists($index, $input)) { |
|
| 413 | $output[$name] = $this->decodeProperty($name, $input[$index]); |
|
| 414 | } |
|
| 415 | } |
|
| 416 | ||
| 417 | return $output; |
|
| 418 | } |
|
| 419 | ||
| 420 | public function encodeProperty($name, $value) |
|
| 421 | { |
|