[CORE][Entity] Compare with object properties when creating/updating, instead of class

This commit is contained in:
Diogo Peralta Cordeiro 2021-08-11 23:46:02 +01:00 committed by Hugo Sales
parent 75f70f8182
commit 4ecdeac6a3
Signed by: someonewithpc
GPG Key ID: 7D0C7EAFC9D835A0

View File

@ -63,7 +63,7 @@ abstract class Entity implements \JsonSerializable
} }
foreach ($args as $prop => $val) { foreach ($args as $prop => $val) {
if (property_exists($class, $prop)) { if (property_exists($obj, $prop)) {
$set = 'set' . ucfirst(Formatting::snakeCaseToCamelCase($prop)); $set = 'set' . ucfirst(Formatting::snakeCaseToCamelCase($prop));
$obj->{$set}($val); $obj->{$set}($val);
} else { } else {