From f220e057bd953817c93243b0ec7f66afd1aa15d7 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Mon, 12 Mar 2018 14:48:20 +0400 Subject: The web service 'local_webhooks_get_list_records' has been expanded Signed-off-by: Valentin Popov --- externallib.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/externallib.php b/externallib.php index 07a2933..b854b55 100644 --- a/externallib.php +++ b/externallib.php @@ -248,23 +248,32 @@ class local_webhooks_external extends external_api { * @since Moodle 2.2 */ public static function get_list_records_parameters() { - return new external_function_parameters(array()); + return new external_function_parameters( + array( + "limitfrom" => new external_value(PARAM_INT, "Where to start results from."), + "limitnum" => new external_value(PARAM_INT, "How many results to return.") + ) + ); } /** * Get all records from the database. * + * @param number $limitfrom + * @param number $limitnum * @return array * @since Moodle 2.9 Options available * @since Moodle 2.2 */ - public static function get_list_records() { + public static function get_list_records($limitfrom, $limitnum) { + $parameters = self::validate_parameters(self::get_list_records_parameters(), array("limitfrom" => $limitfrom, "limitnum" => $limitnum)); + $context = context_system::instance(); self::validate_context($context); $result = array(); - if ($listrecords = local_webhooks_get_list_records()) { + if ($listrecords = local_webhooks_get_list_records($parameters["limitfrom"], $parameters["limitnum"])) { $result = self::formation_list($listrecords); } -- cgit v1.2.3