diff --git a/synchro/synchrodatasource.class.inc.php b/synchro/synchrodatasource.class.inc.php index d9f614113..a4c23e8aa 100644 --- a/synchro/synchrodatasource.class.inc.php +++ b/synchro/synchrodatasource.class.inc.php @@ -553,7 +553,7 @@ class SynchroLog extends CmdbAbstractObject } -class SynchroReplica extends cmdbAbstractObject +class SynchroReplica extends DBObject { static $aSearches = array(); // Cache of OQL queries used for reconciliation (per data source) @@ -602,7 +602,7 @@ class SynchroReplica extends cmdbAbstractObject // Overload the deletion -> the replica has been created by the mean of a trigger, // it will be deleted by the mean of a trigger too - public function DBDeleteTracked_Internal() + public function DBDelete() { $oDataSource = MetaModel::GetObject('SynchroDataSource', $this->Get('sync_source_id')); $sTable = $oDataSource->GetDataTable(); @@ -658,10 +658,12 @@ class SynchroReplica extends cmdbAbstractObject switch($iCount) { case 0: + //echo "

Nothing found for: ".self::$aSearches[$oDataSource->GetKey()]->ToOQL(true, $aFilterValues)."

"; $this->CreateObjectFromReplica($oDataSource->GetTargetClass(), $aAttributes, $oChange); break; case 1: + //echo "

Found 1 for: ".self::$aSearches[$oDataSource->GetKey()]->ToOQL(true, $aFilterValues)."

"; $oDestObj = $oDestSet->Fetch(); $this->UpdateObjectFromReplica($oDestObj, $aAttributes, $oChange); $this->Set('dest_id', $oDestObj->GetKey()); @@ -676,6 +678,7 @@ class SynchroReplica extends cmdbAbstractObject $aConditions[] = $sCode.'='.$sValue; } $sCondition = implode(' AND ', $aConditions); + //echo "

Found N for: ".self::$aSearches[$oDataSource->GetKey()]->ToOQL(true, $aFilterValues)."

"; $this->SetLastError($iCount.' destination objects match the reconciliation criterias: '.$sCondition); } break;