Added internal function 'local_webhooks_delete_events'

Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
Valentin Popov 2018-03-12 23:23:57 +04:00
parent 2c013b3230
commit adb9a1e69c
Signed by: Valentin Popov
GPG Key ID: 269A00ACA90A8EA3

View File

@ -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.
*