aboutsummaryrefslogtreecommitdiff
path: root/lib.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2018-03-12 23:25:55 +0300
committerValentin Popov <info@valentineus.link>2018-03-12 23:25:55 +0300
commite8b59e7b0d0d6a7f2f586092372d0b0e07ee8b27 (patch)
tree3f4f03ed14f550417be2bb71b71080a6b338d812 /lib.php
parent46b602226996a89f63d750e8b08e568680bf9d5d (diff)
downloadlocal_webhooks-e8b59e7b0d0d6a7f2f586092372d0b0e07ee8b27.tar.xz
local_webhooks-e8b59e7b0d0d6a7f2f586092372d0b0e07ee8b27.zip
Update function 'local_webhooks_get_list_records'
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib.php b/lib.php
index 4b8b53d..6227e25 100644
--- a/lib.php
+++ b/lib.php
@@ -95,21 +95,18 @@ function local_webhooks_get_record($serviceid) {
* @param number $limitfrom
* @param number $limitnum
* @param array $conditions
- * @param string $sort
* @return array
*/
-function local_webhooks_get_list_records($limitfrom = 0, $limitnum = 0, $conditions = array(), $sort = "id") {
+function local_webhooks_get_list_records($limitfrom = 0, $limitnum = 0, $conditions = array()) {
global $DB;
- $listrecords = $DB->get_records(LOCAL_WEBHOOKS_TABLE_SERVICES, $conditions, $sort, "*", $limitfrom, $limitnum);
+ $records = $DB->get_records(LOCAL_WEBHOOKS_TABLE_SERVICES, $conditions, "id", "*", $limitfrom, $limitnum);
- foreach ($listrecords as $servicerecord) {
- if (!empty($servicerecord->events)) {
- $servicerecord->events = local_webhooks_deserialization_data($servicerecord->events);
- }
+ foreach ($records as $record) {
+ $record->events = local_webhooks_get_list_events_for_service($record->id);
}
- return $listrecords;
+ return $records;
}
/**