From 984faa91e32a8ab9c0b6ef89c28cd9a800069ebd Mon Sep 17 00:00:00 2001 From: Dmitry Kazartsev Date: Wed, 14 Sep 2016 17:13:50 +0300 Subject: [PATCH] =?UTF-8?q?=D0=95=D1=81=D0=BB=D0=B8=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D0=BF=D0=B5=D1=80=D0=B2=D0=B8=D1=87=D0=BD=D0=BE=D0=BC=D1=83=20?= =?UTF-8?q?=D0=BA=D0=BB=D1=8E=D1=87=D1=83=20=D1=81=20=D0=B8=D1=81=D0=BF?= =?UTF-8?q?=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D0=B5?= =?UTF-8?q?=D0=BC=20find()=20=D0=BD=D0=B8=D1=87=D0=B5=D0=B3=D0=BE=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D0=BD=D0=B0=D0=B9=D0=B4=D0=B5=D0=BD=D0=BE,=20=D0=B2?= =?UTF-8?q?=D0=BE=D0=B7=D0=B2=D1=80=D0=B0=D1=82=D0=B8=D0=BC=20null?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Sberned/RestORM/Model.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Sberned/RestORM/Model.php b/src/Sberned/RestORM/Model.php index 96205f0..1b1cd1e 100644 --- a/src/Sberned/RestORM/Model.php +++ b/src/Sberned/RestORM/Model.php @@ -240,7 +240,12 @@ public static function find(int $id) $newQuery = new Builder($class->getClassName(), $class->getUrl(), $class->getLink() . '/' . $id, 'get', true, []); $newQuery->setValues(self::$_values); - $res = $newQuery->send(); + + try { + $res = $newQuery->send(); + } catch (MassAssignmentException $e) { + return null; + } $className = $class->className;