@@ 317-327 (lines=11) @@ | ||
314 | return $tuple; |
|
315 | } |
|
316 | ||
317 | public function getTuple($input) |
|
318 | { |
|
319 | $output = []; |
|
320 | foreach ($this->getProperties() as $index => $name) { |
|
321 | if (array_key_exists($name, $input)) { |
|
322 | $output[$index] = $this->encodeProperty($name, $input[$name]); |
|
323 | } |
|
324 | } |
|
325 | ||
326 | return $output; |
|
327 | } |
|
328 | ||
329 | public function fromTuple($input) |
|
330 | { |
|
@@ 329-339 (lines=11) @@ | ||
326 | return $output; |
|
327 | } |
|
328 | ||
329 | public function fromTuple($input) |
|
330 | { |
|
331 | $output = []; |
|
332 | foreach ($this->getProperties() as $index => $name) { |
|
333 | if (array_key_exists($index, $input)) { |
|
334 | $output[$name] = $this->decodeProperty($name, $input[$index]); |
|
335 | } |
|
336 | } |
|
337 | ||
338 | return $output; |
|
339 | } |
|
340 | ||
341 | public function encodeProperty($name, $value) |
|
342 | { |