Skip to content

Commit d50bedf

Browse files
committed
A simple try and catch game
1 parent cf884f1 commit d50bedf

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/DataMapper.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,13 @@ protected static function buildMap(array $data, array $mapping, $parent = null)
233233
switch ($type) {
234234
case MappingFieldType::TEXT:
235235
case MappingFieldType::KEYWORD:
236-
$value = (string) $value;
236+
if (\is_array($value)) {
237+
foreach ($value as $k => $v) {
238+
$value[$k] = (string) $v;
239+
}
240+
} else {
241+
$value = (string) $value;
242+
}
237243
break;
238244

239245
case MappingFieldType::SHORT:

0 commit comments

Comments
 (0)