Audit : some more PHPDoc

SVN:trunk[5723]
This commit is contained in:
Pierre Goiffon
2018-04-23 14:46:37 +00:00
parent 9d6b5d347c
commit eaf94bc10a
2 changed files with 20 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
<?php
// Copyright (C) 2010-2017 Combodo SARL
// Copyright (C) 2010-2018 Combodo SARL
//
// This file is part of iTop.
//
@@ -23,11 +23,15 @@
* @license http://opensource.org/licenses/AGPL-3.0
*/
/**
* Adds the context parameters to the audit query
* @param DBSearch $oFilter
* Adds the context parameters to the audit rule query
*
* @param DBObjectSearch $oFilter
* @param ApplicationContext $oAppContext
*
* @throws \CoreException
* @throws \CoreWarning
*/
function FilterByContext(DBSearch &$oFilter, ApplicationContext $oAppContext)
function FilterByContext(DBObjectSearch &$oFilter, ApplicationContext $oAppContext)
{
$sObjClass = $oFilter->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());
}
}
?>