From d441f44698a1ed0bf6cf33c74f910f05ab7d6a08 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Thu, 9 May 2019 20:35:59 +0400 Subject: Added get a total count records Signed-off-by: Valentin Popov --- classes/local/api.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'classes/local') diff --git a/classes/local/api.php b/classes/local/api.php index c937aa5..ea70a91 100644 --- a/classes/local/api.php +++ b/classes/local/api.php @@ -187,6 +187,18 @@ final class api { return $services; } + /** + * Get a total count of existing records. + * + * @return int + * @throws \dml_exception + */ + public static function get_total_count(): int { + global $DB; + + return $DB->count_records(LW_TABLE_SERVICES); + } + /** * Update an existing record in the database. * -- cgit v1.2.3