本文整理汇总了PHP中ApplicationLogs::filterLogs方法的典型用法代码示例。如果您正苦于以下问题:PHP ApplicationLogs::filterLogs方法的具体用法?PHP ApplicationLogs::filterLogs怎么用?PHP ApplicationLogs::filterLogs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ApplicationLogs
的用法示例。
在下文中一共展示了ApplicationLogs::filterLogs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getOverallLogs
/**
* Return overall (for dashboard or RSS)
*
* This function will return array of application logs that match the function arguments. Entries can be filtered by
* type (private, silent), projects (if $project_ids is array, if NULL project ID is ignored). Result set can be
* also limited using $limit and $offset params
*
* @param boolean $include_private
* @param boolean $include_silent
* @param mixed $project_ids
* @param integer $limit
* @param integer $offset
* @return array
*/
static function getOverallLogs($include_private = false, $include_silent = false, $project_ids = null, $limit = null, $offset = null)
{
$private_filter = $include_private ? 1 : 0;
$silent_filter = $include_silent ? 1 : 0;
if (is_array($project_ids)) {
$conditions = array('`is_private` <= ? AND `is_silent` <= ? AND `project_id` IN (?)', $private_filter, $silent_filter, $project_ids);
} else {
$conditions = array('`is_private` <= ? AND `is_silent` <= ?', $private_filter, $silent_filter);
}
// if
$all_logs = self::findAll(array('conditions' => $conditions, 'order' => '`created_on` DESC', 'limit' => $limit, 'offset' => $offset));
// findAll
return ApplicationLogs::filterLogs($all_logs);
}