Skip to content

Commit 9ec1425

Browse files
committed
Fix two more deprecated fetchAll
1 parent bd81a04 commit 9ec1425

2 files changed

Lines changed: 14 additions & 2 deletions

File tree

src/Command/StatsCommand.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,20 @@ public function execute(Arguments $args, ConsoleIo $io)
7272
$query = [
7373
'group' => 'grouped_by',
7474
'order' => 'Incidents.created',
75+
'conditions' => [],
7576
];
7677
if (isset($filter['limit'])) {
7778
$query['conditions'] = [
7879
'Incidents.created >=' => $filter['limit'],
7980
];
8081
}
8182

82-
$downloadStats = $this->Incidents->find('all', $query);
83+
$downloadStats = $this->Incidents->find(
84+
'all',
85+
group: $query['group'],
86+
order: $query['order'],
87+
conditions: $query['conditions'],
88+
);
8389
$downloadStats->select([
8490
'grouped_by' => $filter['group'],
8591
'date' => "DATE_FORMAT(Incidents.created, '%a %b %d %Y %T')",

src/Controller/NotificationsController.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,13 @@ public function data_tables(): Response
152152

153153
$response = [
154154
'iTotalDisplayRecords' => $totalFiltered,
155-
'iTotalRecords' => $this->Notifications->find('all', $params)->count(),
155+
'iTotalRecords' => $this->Notifications->find(
156+
'all',
157+
contain: $params['contain'],
158+
fields: $params['fields'],
159+
conditions: $params['conditions'],
160+
order: $params['order'],
161+
)->count(),
156162
'sEcho' => intval($this->request->getQuery('sEcho')),
157163
'aaData' => $dispRows,
158164
];

0 commit comments

Comments
 (0)