mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 10:38:45 +02:00
N°659 Add uniqueness checks
* modify compiler to save the new rules * add check on object save (\DBObject::DoCheckUniqueness) * default model : add uniqueness rules on Brand, Model, Person
This commit is contained in:
@@ -657,6 +657,18 @@ class iTopDesignFormat
|
||||
// Remove AttributeTagSet nodes
|
||||
//
|
||||
$sPath = "/itop_design/classes/class/fields/field[@xsi:type='AttributeTagSet']";
|
||||
$this->RemoveNodeFromXPath($sPath);
|
||||
|
||||
// Remove uniqueness rules nodes
|
||||
//
|
||||
$sPath = "/itop_design/classes/class/properties/uniqueness_rules";
|
||||
$this->RemoveNodeFromXPath($sPath);
|
||||
}
|
||||
|
||||
private function RemoveNodeFromXPath($sPath)
|
||||
{
|
||||
$oXPath = new DOMXPath($this->oDocument);
|
||||
|
||||
$oNodeList = $oXPath->query($sPath);
|
||||
foreach ($oNodeList as $oNode)
|
||||
{
|
||||
@@ -666,7 +678,6 @@ class iTopDesignFormat
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Delete a node from the DOM and make sure to also remove the immediately following line break (DOMText), if any.
|
||||
* This prevents generating empty lines in the middle of the XML
|
||||
|
||||
Reference in New Issue
Block a user