diff options
author | Valentin Popov <info@valentineus.link> | 2018-03-12 22:29:02 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2018-03-12 22:29:02 +0300 |
commit | 2b7e419f8faa7b8fd55b5bf7c9867f794e36e774 (patch) | |
tree | ff3d63cdb90e96ca9061e02cceedec0838370492 | |
parent | adb9a1e69c0badcd564e47271ae877c971c84bb2 (diff) | |
download | local_webhooks-2b7e419f8faa7b8fd55b5bf7c9867f794e36e774.tar.xz local_webhooks-2b7e419f8faa7b8fd55b5bf7c9867f794e36e774.zip |
Added internal function 'local_webhooks_insert_event'
Signed-off-by: Valentin Popov <info@valentineus.link>
-rw-r--r-- | locallib.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/locallib.php b/locallib.php index d02898b..43eddae 100644 --- a/locallib.php +++ b/locallib.php @@ -72,13 +72,25 @@ function local_webhooks_cache_reset() { } /** + * Adding an event to the database. + * + * @param object $event + * @return boolean + */ +function local_webhooks_insert_event($event) { + global $DB; + return $DB->insert_record(LOCAL_WEBHOOKS_TABLE_EVENTS, $event, true, false); +} + +/** * Deleting all the events linked to the given service. * - * @param number $serviceid + * @param number $serviceid + * @return boolean */ function local_webhooks_delete_events($serviceid) { global $DB; - $DB->delete_records(LOCAL_WEBHOOKS_TABLE_EVENTS, array("serviceid" => $serviceid)); + return $DB->delete_records(LOCAL_WEBHOOKS_TABLE_EVENTS, array("serviceid" => $serviceid)); } /** |