mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-20 09:08:42 +02:00
New option for MFNodes: define_if_not_exists !!
SVN:trunk[2402]
This commit is contained in:
@@ -248,6 +248,20 @@ class ModelFactory
|
||||
}
|
||||
break;
|
||||
|
||||
case 'define_if_not_exists':
|
||||
$oExistingNode = $oTargetParentNode->FindExistingChildNode($oSourceNode);
|
||||
if ($oExistingNode == null)
|
||||
{
|
||||
// Same as 'define' below
|
||||
$oTargetNode = $oTarget->ImportNode($oSourceNode, true);
|
||||
$oTargetParentNode->AddChildNode($oTargetNode);
|
||||
}
|
||||
else
|
||||
{
|
||||
$oTargetNode = $oExistingNode;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'define':
|
||||
// New node - copy child nodes as well
|
||||
$oTargetNode = $oTarget->ImportNode($oSourceNode, true);
|
||||
|
||||
Reference in New Issue
Block a user