Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
$query->select($query->func()->max('id'))
->from('calendarchanges');
- $maxId = $query->executeQuery()->fetchOne();
+ $result = $query->executeQuery();
+ $maxId = (int) $result->fetchOne();
+ $result->closeCursor();
if (!$maxId || $maxId < $keep) {
return 0;
}
$query->select($query->func()->max('id'))
->from('addressbookchanges');
- $maxId = $query->executeQuery()->fetchOne();
+ $result = $query->executeQuery();
+ $maxId = (int) $result->fetchOne();
+ $result->closeCursor();
if (!$maxId || $maxId < $keep) {
return 0;
}