aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-03-12 23:10:56 +0300
committerValentin Popov <info@valentineus.link>2018-03-12 23:10:56 +0300
commitaf4224e8dbfe730ddd822207836702b274ba8f85 (patch)
treed81a7aa5b24d7190963c71a0e6a149ba5830c4f7
parent79fe101e1b7fc311146914026c0369958e4b68c5 (diff)
downloadlocal_webhooks-af4224e8dbfe730ddd822207836702b274ba8f85.tar.xz
local_webhooks-af4224e8dbfe730ddd822207836702b274ba8f85.zip
Renaming internal functions
Signed-off-by: Valentin Popov <info@valentineus.link>
-rw-r--r--lib.php4
-rw-r--r--locallib.php6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib.php b/lib.php
index 8a248e9..fe6bc7f 100644
--- a/lib.php
+++ b/lib.php
@@ -151,7 +151,7 @@ function local_webhooks_create_record($record) {
/* Adding entries */
$transaction = $DB->start_delegated_transaction();
$serviceid = $DB->insert_record(LOCAL_WEBHOOKS_TABLE_SERVICES, $record, true, false);
- local_webhooks_insert_events($serviceid, $record->events);
+ local_webhooks_insert_events_for_service($serviceid, $record->events);
$transaction->allow_commit();
/* Clear the plugin cache */
@@ -183,7 +183,7 @@ function local_webhooks_update_record($record) {
/* Update records */
$transaction = $DB->start_delegated_transaction();
$result = $DB->update_record(LOCAL_WEBHOOKS_TABLE_SERVICES, $record, false);
- local_webhooks_insert_events($record->id, $record->events);
+ local_webhooks_insert_events_for_service($record->id, $record->events);
$transaction->allow_commit();
/* Clear the plugin cache */
diff --git a/locallib.php b/locallib.php
index 392d01d..890e705 100644
--- a/locallib.php
+++ b/locallib.php
@@ -99,7 +99,7 @@ function local_webhooks_get_list_events_for_service($serviceid) {
* @param array $events
* @return boolean
*/
-function local_webhooks_insert_events($serviceid, $events) {
+function local_webhooks_insert_events_for_service($serviceid, $events) {
global $DB;
$records = array();
@@ -112,7 +112,7 @@ function local_webhooks_insert_events($serviceid, $events) {
$records[] = $event;
}
- local_webhooks_delete_events($serviceid);
+ local_webhooks_delete_events_for_service($serviceid);
return $DB->insert_records(LOCAL_WEBHOOKS_TABLE_EVENTS, $records);
}
@@ -122,7 +122,7 @@ function local_webhooks_insert_events($serviceid, $events) {
* @param number $serviceid
* @return boolean
*/
-function local_webhooks_delete_events($serviceid) {
+function local_webhooks_delete_events_for_service($serviceid) {
global $DB;
return $DB->delete_records(LOCAL_WEBHOOKS_TABLE_EVENTS, array("serviceid" => $serviceid));
}