Skip to content

Commit

Permalink
💡 \MetaModel::GetObject : remove documented throw Exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre Goiffon committed Aug 4, 2023
1 parent cd9beec commit c0c8a13
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions core/metamodel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c0c8a13

Please sign in to comment.