fix using a string literal without proper parameter binding in a query builder expression

fix deprecated db query builder execute calls

Signed-off-by: binsky <timo@binsky.org>
This commit is contained in:
binsky 2025-03-09 23:07:14 +01:00
parent f235428850
commit f44591b4fd
No known key found for this signature in database
GPG key ID: B438F7FA2E3AC98F

View file

@ -109,15 +109,15 @@ class NotificationService {
->from('notifications')
->where($qb->expr()->eq('object_id', $qb->createNamedParameter($credential->getId(), IQueryBuilder::PARAM_INT)))
->andWhere($qb->expr()->eq('subject', $qb->createNamedParameter('credential_expired', IQueryBuilder::PARAM_STR)));
return $qb->execute()->rowCount() !== 0;
return $qb->executeQuery()->rowCount() !== 0;
}
function deleteNotificationsOfCredential($credential) {
$qb = $this->db->getQueryBuilder();
$qb->delete('notifications')
->where($qb->expr()->eq('object_id', $qb->createNamedParameter($credential->getId(), IQueryBuilder::PARAM_INT)))
->andWhere($qb->expr()->eq('object_type', 'credential'));
return $qb->execute();
->andWhere($qb->expr()->eq('object_type', $qb->createNamedParameter('credential', IQueryBuilder::PARAM_STR)));
return $qb->executeStatement();
}
function markNotificationOfCredentialAsProcessed(int $credential_id, string $user_id): void {