Rewritten 'local_webhooks_get_record' feature
Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
parent
af4224e8db
commit
2bd5e80b10
9
lib.php
9
lib.php
@ -83,13 +83,10 @@ function local_webhooks_search_services_by_event($eventname, $active = false) {
|
|||||||
function local_webhooks_get_record($serviceid) {
|
function local_webhooks_get_record($serviceid) {
|
||||||
global $DB;
|
global $DB;
|
||||||
|
|
||||||
$servicerecord = $DB->get_record(LOCAL_WEBHOOKS_TABLE_SERVICES, array("id" => $serviceid), "*", MUST_EXIST);
|
$record = $DB->get_record(LOCAL_WEBHOOKS_TABLE_SERVICES, array("id" => $serviceid), "*", IGNORE_MISSING);
|
||||||
|
$record->events = local_webhooks_get_list_events_for_service($serviceid);
|
||||||
|
|
||||||
if (!empty($servicerecord->events)) {
|
return $record;
|
||||||
$servicerecord->events = local_webhooks_deserialization_data($servicerecord->events);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $servicerecord;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user