Creation of indexes on several columns (exploited for a few classes when it was obvious)

SVN:trunk[2924]
This commit is contained in:
Romain Quetiez
2013-10-16 15:21:20 +00:00
parent eda203af26
commit 401d61aa76
7 changed files with 140 additions and 17 deletions

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2011-2012 Combodo SARL
// Copyright (C) 2011-2013 Combodo SARL
//
// This file is part of iTop.
//
@@ -654,7 +654,22 @@ EOF;
$aClassParams['order_by_default'] = "array(".implode(", ", $aSortColumns).")";
}
}
if ($oIndexes = $oProperties->GetOptionalElement('indexes'))
{
$aIndexes = array();
foreach($oIndexes->getElementsByTagName('index') as $oIndex)
{
$sIndexId = $oIndex->getAttribute('id');
$oAttributes = $oIndex->GetUniqueElement('attributes');
foreach($oAttributes->getElementsByTagName('attribute') as $oAttribute)
{
$aIndexes[$sIndexId][] = $oAttribute->getAttribute('id');
}
}
$aClassParams['indexes'] = var_export($aIndexes, true);
}
// Finalize class params declaration
//