Minor fixes to the function 'get_services'

Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
Valentin Popov 2018-09-09 04:28:51 +04:00
parent 2194bc4a01
commit 270c04a603
Signed by: Valentin Popov
GPG Key ID: 269A00ACA90A8EA3

13
lib.php
View File

@ -63,18 +63,17 @@ class local_webhooks_api {
* Get a list of services.
* By default, the entire list of services is given.
*
* @param array $conditions
* @param string $sort
* @param int $limitFrom
* @param int $limitNum
* @param array $conditions
* @param int $limitFrom
* @param int $limitNum
* @return array
*/
public static function get_services( $conditions = array(), $sort = "", $limitFrom = 0, $limitNum = 0 ) {
public static function get_services( $conditions = array(), $limitFrom = 0, $limitNum = 0 ) {
global $DB;
$services = $DB->get_records( LW_TABLE_SERVICES, $conditions, $sort, "*", $limitFrom, $limitNum );
$services = $DB->get_records( LW_TABLE_SERVICES, $conditions, "", "*", $limitFrom, $limitNum );
foreach ( $services as $key => $service ) {
foreach ( $services as $service ) {
$events = $DB->get_records( LW_TABLE_EVENTS, array( "serviceid" => $service->id ), "", "*", 0, 0 );
$service->events = array();