本文整理汇总了PHP中webservice::get_external_function_by_id方法的典型用法代码示例。如果您正苦于以下问题:PHP webservice::get_external_function_by_id方法的具体用法?PHP webservice::get_external_function_by_id怎么用?PHP webservice::get_external_function_by_id使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类webservice
的用法示例。
在下文中一共展示了webservice::get_external_function_by_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
switch ($action) {
case 'add':
$PAGE->navbar->add(get_string('addfunctions', 'webservice'));
/// Add function operation
if (confirm_sesskey() and $service and empty($service->component)) {
$mform = new external_service_functions_form(null, array('action' => 'add', 'id' => $service->id));
//cancelled add operation, redirect to function list page
if ($mform->is_cancelled()) {
redirect($functionlisturl);
}
//add the function to the service then redirect to function list page
if ($data = $mform->get_data()) {
ignore_user_abort(true);
// no interruption here!
foreach ($data->fids as $fid) {
$function = $webservicemanager->get_external_function_by_id($fid, MUST_EXIST);
// make sure the function is not there yet
if (!$webservicemanager->service_function_exists($function->name, $service->id)) {
$webservicemanager->add_external_function_to_service($function->name, $service->id);
}
}
redirect($functionlisturl);
}
//Add function operation page output
echo $OUTPUT->header();
echo $OUTPUT->heading($service->name);
$mform->display();
echo $OUTPUT->footer();
die;
}
break;