aboutsummaryrefslogtreecommitdiff
path: root/classes/local/api.php
diff options
context:
space:
mode:
authorValentin Popov <info@valentineus.link>2019-05-09 19:35:59 +0300
committerValentin Popov <info@valentineus.link>2019-05-09 19:35:59 +0300
commitd441f44698a1ed0bf6cf33c74f910f05ab7d6a08 (patch)
tree1ad55cf66e27ed9c2ba18aaa1f1eaf5f6b675f71 /classes/local/api.php
parentcb6d5c7e13c0eee799b0e9fcb42432eaad674117 (diff)
downloadlocal_webhooks-d441f44698a1ed0bf6cf33c74f910f05ab7d6a08.tar.xz
local_webhooks-d441f44698a1ed0bf6cf33c74f910f05ab7d6a08.zip
Added get a total count records
Signed-off-by: Valentin Popov <info@valentineus.link>
Diffstat (limited to 'classes/local/api.php')
-rw-r--r--classes/local/api.php12
1 files changed, 12 insertions, 0 deletions
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
@@ -188,6 +188,18 @@ final class api {
}
/**
+ * 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.
*
* @param \local_webhooks\local\record $service