/**
* Get total available user groups in database.
*
* @return integer
*
* @since 3.6.3
*/
public function total()
{
if ($this->total === null) {
$db = Factory::getDbo();
$query = $db->getQuery(true)->select('COUNT(' . $db->quoteName('id') . ')')->from($db->quoteName('#__usergroups'));
$db->setQuery($query);
$this->total = (int) $db->loadResult();
}
return $this->total;
}