mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 17:23:59 -04:00
feat(webhook_listeners): Add mapper method to remove all registrations from a given AppAPI id
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
8f6620d552
commit
6c1a6d17c2
1 changed files with 15 additions and 0 deletions
|
|
@ -159,6 +159,21 @@ class WebhookListenerMapper extends QBMapper {
|
|||
return ($qb->executeStatement() > 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all registrations made by the given appId
|
||||
*
|
||||
* @throws Exception
|
||||
* @return int number of registration deleted
|
||||
*/
|
||||
public function deleteByAppId(string $appId): int {
|
||||
$qb = $this->db->getQueryBuilder();
|
||||
|
||||
$qb->delete($this->getTableName())
|
||||
->where($qb->expr()->eq('app_id', $qb->createNamedParameter($appId, IQueryBuilder::PARAM_STR)));
|
||||
|
||||
return $qb->executeStatement();
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
* @return list<string>
|
||||
|
|
|
|||
Loading…
Reference in a new issue