mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Merge remote-tracking branch 'origin/support/2.7' into support/3.0
# Conflicts: # core/metamodel.class.php
This commit is contained in:
@@ -6990,25 +6990,21 @@ abstract class MetaModel
|
|||||||
* $bMustBeFound=false)
|
* $bMustBeFound=false)
|
||||||
* @throws CoreException if no result found and $bMustBeFound=true
|
* @throws CoreException if no result found and $bMustBeFound=true
|
||||||
* @throws ArchivedObjectException if archive mode disabled and result is archived 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)
|
public static function GetObject($sClass, $iKey, $bMustBeFound = true, $bAllowAllData = false, $aModifierProperties = null)
|
||||||
{
|
{
|
||||||
$oObject = self::GetObjectWithArchive($sClass, $iKey, $bMustBeFound, $bAllowAllData, $aModifierProperties);
|
$oObject = self::GetObjectWithArchive($sClass, $iKey, $bMustBeFound, $bAllowAllData, $aModifierProperties);
|
||||||
|
|
||||||
if (empty($oObject))
|
if (empty($oObject)) {
|
||||||
{
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!utils::IsArchiveMode() && $oObject->IsArchived())
|
if (!utils::IsArchiveMode() && $oObject->IsArchived()) {
|
||||||
{
|
|
||||||
if ($bMustBeFound) {
|
if ($bMustBeFound) {
|
||||||
throw new ArchivedObjectException("The object $sClass::$iKey is archived");
|
throw new ArchivedObjectException("The object $sClass::$iKey is archived");
|
||||||
} else {
|
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $oObject;
|
return $oObject;
|
||||||
|
|||||||
Reference in New Issue
Block a user