diff options
author | Valentin Popov <info@valentineus.link> | 2019-05-09 19:35:59 +0300 |
---|---|---|
committer | Valentin Popov <info@valentineus.link> | 2019-05-09 19:35:59 +0300 |
commit | d441f44698a1ed0bf6cf33c74f910f05ab7d6a08 (patch) | |
tree | 1ad55cf66e27ed9c2ba18aaa1f1eaf5f6b675f71 /classes/local | |
parent | cb6d5c7e13c0eee799b0e9fcb42432eaad674117 (diff) | |
download | local_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')
-rw-r--r-- | classes/local/api.php | 12 |
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 |