diff options
author | Valentin Popov <info@valentineus.link> | 2018-03-12 13:48:20 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2018-03-12 13:48:20 +0300 |
commit | f220e057bd953817c93243b0ec7f66afd1aa15d7 (patch) | |
tree | ef8d6fde78b161843205ac2f2759193d5a145890 /externallib.php | |
parent | 422cbfd57d1f411cde77051e9daa96ea9cafe742 (diff) | |
download | local_webhooks-f220e057bd953817c93243b0ec7f66afd1aa15d7.tar.xz local_webhooks-f220e057bd953817c93243b0ec7f66afd1aa15d7.zip |
The web service 'local_webhooks_get_list_records' has been expanded
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'externallib.php')
-rw-r--r-- | externallib.php | 15 |
1 files 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); } |