chg: [event model] fetchEvent() now accepts page/limit/order as parameters

pull/7002/head
iglocska 2021-02-15 18:08:41 +01:00
parent ff828cbb30
commit 6112c0d406
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 15 additions and 3 deletions

View File

@ -1325,7 +1325,7 @@ class Event extends AppModel
if (!$eventReportSupportedByRemote) {
return [];
}
// Downgrade the object from connected communities to community only
if (!$server['Server']['internal'] && $report['distribution'] == 2) {
$report['distribution'] = 1;
@ -1852,7 +1852,10 @@ class Event extends AppModel
'includeServerCorrelations',
'includeWarninglistHits',
'noEventReports', // do not include event report in event data
'noShadowAttributes', // do not fetch proposals
'noShadowAttributes', // do not fetch proposals,
'limit',
'page',
'order'
);
if (!isset($options['excludeLocalTags']) && !empty($user['Role']['perm_sync']) && empty($user['Role']['perm_site_admin'])) {
$options['excludeLocalTags'] = 1;
@ -2137,6 +2140,15 @@ class Event extends AppModel
unset($params['contain']['Object']);
unset($params['contain']['EventReport']);
}
if (!empty($options['limit'])) {
$params['limit'] = $options['limit'];
}
if (!empty($options['page'])) {
$params['page'] = $options['page'];
}
if (!empty($options['order'])) {
$params['order'] = $options['order'];
}
$results = $this->find('all', $params);
if (empty($results)) {
return array();
@ -7169,7 +7181,7 @@ class Event extends AppModel
}
}
}
/**
* extractAllTagNames Returns all tag names attached to any elements in an event
*