@@ 376-386 (lines=11) @@ | ||
373 | return $tuple; |
|
374 | } |
|
375 | ||
376 | public function getTuple($input) |
|
377 | { |
|
378 | $output = []; |
|
379 | foreach ($this->getProperties() as $index => $name) { |
|
380 | if (array_key_exists($name, $input)) { |
|
381 | $output[$index] = $this->encodeProperty($name, $input[$name]); |
|
382 | } |
|
383 | } |
|
384 | ||
385 | return $output; |
|
386 | } |
|
387 | ||
388 | public function fromTuple($input) |
|
389 | { |
|
@@ 388-398 (lines=11) @@ | ||
385 | return $output; |
|
386 | } |
|
387 | ||
388 | public function fromTuple($input) |
|
389 | { |
|
390 | $output = []; |
|
391 | foreach ($this->getProperties() as $index => $name) { |
|
392 | if (array_key_exists($index, $input)) { |
|
393 | $output[$name] = $this->decodeProperty($name, $input[$index]); |
|
394 | } |
|
395 | } |
|
396 | ||
397 | return $output; |
|
398 | } |
|
399 | ||
400 | public function encodeProperty($name, $value) |
|
401 | { |