| @@ 352-362 (lines=11) @@ | ||
| 349 | return $tuple; |
|
| 350 | } |
|
| 351 | ||
| 352 | public function getTuple($input) |
|
| 353 | { |
|
| 354 | $output = []; |
|
| 355 | foreach ($this->getProperties() as $index => $name) { |
|
| 356 | if (array_key_exists($name, $input)) { |
|
| 357 | $output[$index] = $this->encodeProperty($name, $input[$name]); |
|
| 358 | } |
|
| 359 | } |
|
| 360 | ||
| 361 | return $output; |
|
| 362 | } |
|
| 363 | ||
| 364 | public function fromTuple($input) |
|
| 365 | { |
|
| @@ 364-374 (lines=11) @@ | ||
| 361 | return $output; |
|
| 362 | } |
|
| 363 | ||
| 364 | public function fromTuple($input) |
|
| 365 | { |
|
| 366 | $output = []; |
|
| 367 | foreach ($this->getProperties() as $index => $name) { |
|
| 368 | if (array_key_exists($index, $input)) { |
|
| 369 | $output[$name] = $this->decodeProperty($name, $input[$index]); |
|
| 370 | } |
|
| 371 | } |
|
| 372 | ||
| 373 | return $output; |
|
| 374 | } |
|
| 375 | ||
| 376 | public function encodeProperty($name, $value) |
|
| 377 | { |
|