From adb9a1e69c0badcd564e47271ae877c971c84bb2 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 12 Mar 2018 23:23:57 +0400 Subject: Added internal function 'local_webhooks_delete_events' Signed-off-by: Valentin Popov --- locallib.php | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'locallib.php') diff --git a/locallib.php b/locallib.php index 6ad80b6..d02898b 100644 --- a/locallib.php +++ b/locallib.php @@ -71,6 +71,16 @@ function local_webhooks_cache_reset() { return $cache->purge(); } +/** + * Deleting all the events linked to the given service. + * + * @param number $serviceid + */ +function local_webhooks_delete_events($serviceid) { + global $DB; + $DB->delete_records(LOCAL_WEBHOOKS_TABLE_EVENTS, array("serviceid" => $serviceid)); +} + /** * Data serialization. * -- cgit v1.2.3