Skip to content

Commit

Permalink
Fix: replace usage of nextRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesDPC committed Nov 1, 2024
1 parent a92c345 commit 5856a8e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Jobs/PruneViolationReportsJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ public function getTitle()
public function getRecordCount()
{
$query = "SELECT COUNT(ID) AS RecordCount FROM \"CspViolationReport\"";
$result = DB::query($query);
if ($result) {
$row = $result->nextRecord();
return isset($row['RecordCount']) ? $row['RecordCount'] : 0;
if($result = DB::query($query)) {
$row = $result->record();
return $row['RecordCount'] ?? 0;
} else {
return 0;
}
return 0;
}

public function process()
Expand Down

0 comments on commit 5856a8e

Please sign in to comment.