| @@ 185-198 (lines=14) @@ | ||
| 182 | private function mapColumnValueToPropertyValue($value, string $type) |
|
| 183 | { |
|
| 184 | // TODO use a serializer service for this, so we can have ValueObjects |
|
| 185 | switch ($type) { |
|
| 186 | case 'datetime': |
|
| 187 | return DateTime::createFromFormat($this->dateTimeFormat, $value); |
|
| 188 | ||
| 189 | case 'text': |
|
| 190 | settype($value, 'string'); |
|
| 191 | ||
| 192 | return $value; |
|
| 193 | ||
| 194 | default: |
|
| 195 | settype($value, $type); |
|
| 196 | ||
| 197 | return $value; |
|
| 198 | } |
|
| 199 | } |
|
| 200 | ||
| 201 | private function mapPropertyValueToColumnValue($value, string $type) |
|
| @@ 208-221 (lines=14) @@ | ||
| 205 | } |
|
| 206 | ||
| 207 | // TODO use a serializer service for this, so we can have ValueObjects |
|
| 208 | switch ($type) { |
|
| 209 | case 'datetime': |
|
| 210 | return date_format($value, $this->dateTimeFormat); |
|
| 211 | ||
| 212 | case 'text': |
|
| 213 | settype($value, 'string'); |
|
| 214 | ||
| 215 | return $value; |
|
| 216 | ||
| 217 | default: |
|
| 218 | settype($value, $type); |
|
| 219 | ||
| 220 | return $value; |
|
| 221 | } |
|
| 222 | } |
|
| 223 | ||
| 224 | private function createEntity(): EntityInterface |
|