Skip to content

Commit 58f8026

Browse files
committed
Fix entity toArray to properly return only changed value (after datamap).
1 parent ffd7477 commit 58f8026

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

system/Entity.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,12 @@ public function toArray(bool $onlyChanged = false, bool $cast = true): array
182182
{
183183
foreach ($this->datamap as $from => $to)
184184
{
185-
$return[$from] = $this->__get($to);
185+
if (array_key_exists($to, $return)) {
186+
$return[$from] = $this->__get($to);
187+
}
186188
}
187189
}
190+
188191
$this->_cast = true;
189192
return $return;
190193
}

0 commit comments

Comments
 (0)