mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-12 12:34:12 +01:00
Fixed bug on deletion: take the inheritance into account when checking for referencing objects (eg. a ticket linked to a PC was not seen)
SVN:code[180]
This commit is contained in:
@@ -847,6 +847,29 @@ abstract class DBObject
|
||||
}
|
||||
return $aResults;
|
||||
}
|
||||
|
||||
public function GetReferencingObjects()
|
||||
{
|
||||
$aDependentObjects = array();
|
||||
$aRererencingMe = MetaModel::EnumReferencingClasses(get_class($this));
|
||||
foreach($aRererencingMe as $sRemoteClass => $aExtKeys)
|
||||
{
|
||||
foreach($aExtKeys as $sExtKeyAttCode => $oExtKeyAttDef)
|
||||
{
|
||||
//$oAttDef = MetaModel::GetAttributeDef($sClass, $sExtKeyAttCode);
|
||||
|
||||
$oSearch = new DBObjectSearch($sRemoteClass);
|
||||
$oSearch->AddCondition($sExtKeyAttCode, $this->GetKey());
|
||||
$oSet = new CMDBObjectSet($oSearch);
|
||||
//if ($oSet->Count() > 0)
|
||||
while ($oDependentObj = $oSet->fetch())
|
||||
{
|
||||
$aDependentObjects[$sRemoteClass][] = $oDependentObj;
|
||||
}
|
||||
}
|
||||
}
|
||||
return $aDependentObjects;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user