Renaming internal functions

Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
Valentin Popov 2018-03-13 00:10:56 +04:00
parent 79fe101e1b
commit af4224e8db
Signed by: Valentin Popov
GPG Key ID: 269A00ACA90A8EA3
2 changed files with 5 additions and 5 deletions

View File

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

View File

@ -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));
}