From 65f285e93f6b6b86e9cfb627b447de0ff53cb7c3 Mon Sep 17 00:00:00 2001 From: yuri Date: Tue, 24 Oct 2017 11:45:45 +0300 Subject: [PATCH] entity set object support --- application/Espo/ORM/Entity.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/Espo/ORM/Entity.php b/application/Espo/ORM/Entity.php index 105708737a..9681d86f27 100644 --- a/application/Espo/ORM/Entity.php +++ b/application/Espo/ORM/Entity.php @@ -110,12 +110,15 @@ abstract class Entity implements IEntity public function set($p1, $p2 = null) { - if (is_array($p1)) { + if (is_array($p1) || is_object($p1)) { + if (is_object($p1)) { + $p1 = get_object_vars($p1); + } if ($p2 === null) { $p2 = false; } $this->populateFromArray($p1, $p2); - } else { + } else if (is_string($p1)) { $name = $p1; $value = $p2; if ($name == 'id') {