Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat(webhook_listeners): Add mapper method to remove all registration…
…s from a given AppAPI id

Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc authored and backportbot[bot] committed Sep 9, 2024
commit 6c1a6d17c2e2c295b5a7ffaaa9bec1decab19b0f
15 changes: 15 additions & 0 deletions apps/webhook_listeners/lib/Db/WebhookListenerMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,21 @@ public function deleteById(int $id): bool {
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>
Expand Down