Retrofit from trunk

DBObject->GetOriginal() hardening (now support attributes not set: for example sla_tto_passed for UserRequest until it is closed)
[from revision 5932]

SVN:2.5[5942]
This commit is contained in:
Eric Espié
2018-07-17 12:19:26 +00:00
parent 6e9fcb81f0
commit e184eb6aae
3 changed files with 33 additions and 6 deletions

View File

@@ -112,6 +112,26 @@ class ItopDataTestCase extends ItopTestCase
return $oMyObj;
}
/**
* @param string $sClass
* @param $iKey
* @param array $aParams
*
* @return DBObject
* @throws \ArchivedObjectException
* @throws \CoreException
* @throws \CoreUnexpectedValue
*/
protected static function updateObject($sClass, $iKey, $aParams)
{
$oMyObj = MetaModel::GetObject($sClass, $iKey);
foreach($aParams as $sAttCode => $oValue)
{
$oMyObj->Set($sAttCode, $oValue);
}
$oMyObj->DBUpdate();
return $oMyObj;
}
/**
* Create an Organization in database