diff --git a/core/dbsearch.class.php b/core/dbsearch.class.php index ce74950ba..cbc340eed 100644 --- a/core/dbsearch.class.php +++ b/core/dbsearch.class.php @@ -298,7 +298,7 @@ abstract class DBSearch /** * @param string $sQuery * @param array $aParams - * @return DBSearch + * @return self * @throws OQLException */ static public function FromOQL($sQuery, $aParams = null) diff --git a/pages/audit.php b/pages/audit.php index b15da1aaf..5e52c1494 100644 --- a/pages/audit.php +++ b/pages/audit.php @@ -1,5 +1,5 @@ GetClass(); $aContextParams = $oAppContext->GetNames(); @@ -86,6 +90,16 @@ function FilterByContext(DBSearch &$oFilter, ApplicationContext $oAppContext) } } +/** + * @param int $iRuleId Audit rule ID + * @param DBObjectSearch $oDefinitionFilter Created from the audit category's OQL + * @param ApplicationContext $oAppContext + * + * @return mixed + * @throws \ArchivedObjectException + * @throws \CoreException + * @throws \OQLException + */ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext) { $oRule = MetaModel::GetObject('AuditRule', $iRuleId); @@ -102,6 +116,7 @@ function GetRuleResultFilter($iRuleId, $oDefinitionFilter, $oAppContext) else { // The query returns only the valid elements, all the others are invalid + // Warning : we're generating a `WHERE ID IN`... query, and this could be very slow if there are lots of id ! $aValidRows = $oRuleFilter->ToDataArray(array('id')); $aValidIds = array(); foreach($aValidRows as $aRow) @@ -415,4 +430,3 @@ catch(Exception $e) IssueLog::Error($e->getMessage()); } } -?>