mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
DBSearch : Allow join between DBUnionSearch by adding the DBUnionSearch::Join verb
SVN:trunk[3952]
This commit is contained in:
@@ -368,6 +368,31 @@ class DBUnionSearch extends DBSearch
|
||||
return $sRet;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a new DBUnionSearch object where duplicates queries have been removed based on their OQLs
|
||||
*
|
||||
* @return \DBUnionSearch
|
||||
*/
|
||||
public function RemoveDuplicateQueries()
|
||||
{
|
||||
$aQueries = array();
|
||||
$aSearches = array();
|
||||
|
||||
foreach ($this->GetSearches() as $oTmpSearch)
|
||||
{
|
||||
$sQuery = $oTmpSearch->ToOQL(true);
|
||||
if (!in_array($sQuery, $aQueries))
|
||||
{
|
||||
$aQueries[] = $sQuery;
|
||||
$aSearches[] = $oTmpSearch;
|
||||
}
|
||||
}
|
||||
|
||||
$oNewSearch = new DBUnionSearch($aSearches);
|
||||
|
||||
return $oNewSearch;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Construction of the SQL queries
|
||||
|
||||
Reference in New Issue
Block a user