From 9da93a73d9094f06428886901353dd5cf4ada4e2 Mon Sep 17 00:00:00 2001 From: PMKuipers Date: Mon, 26 Jun 2023 11:57:05 +0200 Subject: [PATCH] Rename of service before use --- classes/associationservice.php | 6 +++--- db/services.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/associationservice.php b/classes/associationservice.php index e6c66e4..cf7ee41 100644 --- a/classes/associationservice.php +++ b/classes/associationservice.php @@ -448,20 +448,20 @@ class associationservice extends \external_api }); } - public static function enrol_cohortsync_parameters() + public static function cascade_cohortsync_parameters() { return new \external_function_parameters( [ "studyplan_id" => new \external_value(PARAM_INT, 'id of studyplan', VALUE_OPTIONAL), ] ); } - public static function enrol_cohortsync_returns() + public static function cascade_cohortsync_returns() { return success::structure(); } // Actual functions - public static function enrol_cohortsync($studyplan_id) + public static function casdade_cohortsync($studyplan_id) { $studyplan = studyplan::findById($studyplan_id); webservicehelper::require_capabilities(self::CAP_EDIT,$studyplan->context()); diff --git a/db/services.php b/db/services.php index d311335..76168cb 100644 --- a/db/services.php +++ b/db/services.php @@ -542,9 +542,9 @@ $functions = [ 'ajax' => true, 'loginrequired' => true, ], - 'local_treestudyplan_enrol_cohortsync' => [ //web service function name + 'local_treestudyplan_cascade_cohortsync' => [ //web service function name 'classname' => '\local_treestudyplan\associationservice', //class containing the external function - 'methodname' => 'enrol_cohortsync', //external function name + 'methodname' => 'cascade_cohortsync', //external function name 'description' => 'Sync cohortsync to studyplan association', //human readable description of the web service function 'type' => 'read', //database rights of the web service function (read, write) 'capabilities' => 'local/treestudyplan:editstudyplan', // Advises the admin which capabilities are required