From c0c8a13864647a2054b733a26d25a5c88cb0746c Mon Sep 17 00:00:00 2001 From: Pierre Goiffon Date: Fri, 4 Aug 2023 14:55:38 +0200 Subject: [PATCH] :bulb: \MetaModel::GetObject : remove documented throw Exception --- core/metamodel.class.php | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/core/metamodel.class.php b/core/metamodel.class.php index bd0dd03ebe..8f987efd2f 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -6787,28 +6787,21 @@ public static function GetObjectByRow($sClass, $aRow, $sClassAlias = '', $aAttTo * $bMustBeFound=false) * @throws CoreException if no result found and $bMustBeFound=true * @throws ArchivedObjectException if archive mode disabled and result is archived and $bMustBeFound=true - * @throws \Exception - * */ public static function GetObject($sClass, $iKey, $bMustBeFound = true, $bAllowAllData = false, $aModifierProperties = null) { $oObject = self::GetObjectWithArchive($sClass, $iKey, $bMustBeFound, $bAllowAllData, $aModifierProperties); - if (empty($oObject)) - { + if (empty($oObject)) { return null; } - if (!utils::IsArchiveMode() && $oObject->IsArchived()) - { - if ($bMustBeFound) - { + if (!utils::IsArchiveMode() && $oObject->IsArchived()) { + if ($bMustBeFound) { throw new ArchivedObjectException("The object $sClass::$iKey is archived"); } - else - { - return null; - } + + return null; } return $oObject;