From c1cfa0483a2dda2df6a58cbafb5d38245564ce95 Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 15 Feb 2023 15:15:13 +0200 Subject: [PATCH] orm update in not null --- application/Espo/ORM/Query/Update.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/application/Espo/ORM/Query/Update.php b/application/Espo/ORM/Query/Update.php index 8d403ff57e..ad495489e0 100644 --- a/application/Espo/ORM/Query/Update.php +++ b/application/Espo/ORM/Query/Update.php @@ -44,9 +44,15 @@ class Update implements Query /** * Get an entity type. */ - public function getIn(): ?string + public function getIn(): string { - return $this->params['from'] ?? null; + $in = $this->params['from']; + + if ($in === null) { + throw new RuntimeException("Missing 'in'."); + } + + return $in; } /** @@ -58,7 +64,7 @@ class Update implements Query } /** - * @param array $params + * @param array $params */ private function validateRawParams(array $params): void { @@ -67,7 +73,7 @@ class Update implements Query $from = $params['from'] ?? null; if (!$from || !is_string($from)) { - throw new RuntimeException("Select params: Missing 'in'."); + throw new RuntimeException("Update params: Missing 'in'."); } $set = $params['set'] ?? null;