N°2163 DB*Tracked methods : modifications after review with Romain

Previous commit : 24eb82d1
Use \CMDBObject::SetTrackInfo
Move \CMDBObject::SetCurrentChange calls at the top most level of the stacks
Restore old behaviors that were removed in previous commit
This commit is contained in:
Pierre Goiffon
2019-11-25 09:41:20 +01:00
parent 2f2d9547b7
commit 0ee77d8c88
13 changed files with 39 additions and 76 deletions

View File

@@ -519,7 +519,6 @@ abstract class WebServicesBase
/**
* @param \CMDBObject $oTargetObj
* @param string $sResultLabel
* @param \CMDBChange $oChange
* @param \WebServiceResult $oRes
*
* @throws \ArchivedObjectException
@@ -531,14 +530,13 @@ abstract class WebServicesBase
* @throws \OQLException
* @throws \SecurityException
*/
protected function MyObjectInsert($oTargetObj, $sResultLabel, $oChange, &$oRes)
protected function MyObjectInsert($oTargetObj, $sResultLabel, &$oRes)
{
if ($oRes->IsOk())
{
list($bRes, $aIssues) = $oTargetObj->CheckToWrite();
if ($bRes)
{
$oTargetObj::SetCurrentChange($oChange);
$iId = $oTargetObj->DBInsertNoReload();
$oRes->LogInfo("Created object ".get_class($oTargetObj)."::$iId");
$oRes->AddResultObject($sResultLabel, $oTargetObj);