aboutsummaryrefslogtreecommitdiff
path: root/locallib.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-03-12 22:29:02 +0300
committerValentin Popov <info@valentineus.link>2018-03-12 22:29:02 +0300
commit2b7e419f8faa7b8fd55b5bf7c9867f794e36e774 (patch)
treeff3d63cdb90e96ca9061e02cceedec0838370492 /locallib.php
parentadb9a1e69c0badcd564e47271ae877c971c84bb2 (diff)
downloadlocal_webhooks-2b7e419f8faa7b8fd55b5bf7c9867f794e36e774.tar.xz
local_webhooks-2b7e419f8faa7b8fd55b5bf7c9867f794e36e774.zip
Added internal function 'local_webhooks_insert_event'
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'locallib.php')
-rw-r--r--locallib.php16
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));
}
/**