Rename of service before use
This commit is contained in:
parent
e64e87f373
commit
9da93a73d9
2 changed files with 5 additions and 5 deletions
|
@ -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( [
|
return new \external_function_parameters( [
|
||||||
"studyplan_id" => new \external_value(PARAM_INT, 'id of studyplan', VALUE_OPTIONAL),
|
"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();
|
return success::structure();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actual functions
|
// Actual functions
|
||||||
public static function enrol_cohortsync($studyplan_id)
|
public static function casdade_cohortsync($studyplan_id)
|
||||||
{
|
{
|
||||||
$studyplan = studyplan::findById($studyplan_id);
|
$studyplan = studyplan::findById($studyplan_id);
|
||||||
webservicehelper::require_capabilities(self::CAP_EDIT,$studyplan->context());
|
webservicehelper::require_capabilities(self::CAP_EDIT,$studyplan->context());
|
||||||
|
|
|
@ -542,9 +542,9 @@ $functions = [
|
||||||
'ajax' => true,
|
'ajax' => true,
|
||||||
'loginrequired' => 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
|
'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
|
'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)
|
'type' => 'read', //database rights of the web service function (read, write)
|
||||||
'capabilities' => 'local/treestudyplan:editstudyplan', // Advises the admin which capabilities are required
|
'capabilities' => 'local/treestudyplan:editstudyplan', // Advises the admin which capabilities are required
|
||||||
|
|
Loading…
Reference in a new issue