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:
Pierre Goiffon
2018-10-19 14:31:55 +02:00
parent cd5e1afb2b
commit 574d72b0e7
34 changed files with 670 additions and 29 deletions

View File

@@ -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