Skip to content

Commit 3fca77a

Browse files
authored
Update DataMapper.php
Fix The Fix
1 parent 1499f02 commit 3fca77a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/DataMapper.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,13 @@ protected static function buildMap(array $data, array $mapping, $parent = null)
273273
// Check if $value is associative.
274274
if (\is_array(\current($value))) {
275275
foreach ($value as $k => $v) {
276+
$nestedPKey = $pKey;
277+
276278
if (isset($mapping['flat'][$pKey . '.' . $k])) {
277-
$pKey = $pKey . '.' . $k;
279+
$nestedPKey = ($pKey . '.' . $k);
278280
}
279281

280-
$value[$k] = self::buildMap($v, $mapping, $pKey);
282+
$value[$k] = self::buildMap($v, $mapping, $nestedPKey);
281283
}
282284
} else {
283285
$value = self::buildMap($value, $mapping, $pKey);

0 commit comments

Comments
 (0)