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

@@ -434,22 +434,13 @@ abstract class TestBizModel extends TestHandler
}
protected function ObjectToDB($oNew, $bReload = false)
{
if ($oNew instanceof CMDBObject)
if ($bReload)
{
$oChange = $this->GetCurrentChange();
$oNew::SetCurrentChange($oChange);
$oNew->DBWrite();
$iId = $oNew->DBInsert();
}
else
{
if ($bReload)
{
$iId = $oNew->DBInsert();
}
else
{
$iId = $oNew->DBInsertNoReload();
}
$iId = $oNew->DBInsertNoReload();
}
return $iId;
}