| @@ 101-110 (lines=10) @@ | ||
| 98 | return in_array($name, $this->properties); |
|
| 99 | } |
|
| 100 | ||
| 101 | public function encode($input) |
|
| 102 | { |
|
| 103 | $output = []; |
|
| 104 | foreach ($this->getMapping() as $index => $name) { |
|
| 105 | if (array_key_exists($name, $input)) { |
|
| 106 | $output[$index] = $input[$name]; |
|
| 107 | } |
|
| 108 | } |
|
| 109 | return $output; |
|
| 110 | } |
|
| 111 | ||
| 112 | public function decode($input) |
|
| 113 | { |
|
| @@ 112-121 (lines=10) @@ | ||
| 109 | return $output; |
|
| 110 | } |
|
| 111 | ||
| 112 | public function decode($input) |
|
| 113 | { |
|
| 114 | $output = []; |
|
| 115 | foreach ($this->getMapping() as $index => $name) { |
|
| 116 | if (array_key_exists($index, $input)) { |
|
| 117 | $output[$name] = $input[$index]; |
|
| 118 | } |
|
| 119 | } |
|
| 120 | return $output; |
|
| 121 | } |
|
| 122 | } |
|
| 123 | ||