Back to UserGroupsHelper class

Method loadAll

public self
loadAll
()
Load all user groups from the database.
Returns
  • self
Since
  • 3.6.3

Method loadAll - Source code

/**
 * Load all user groups from the database.
 *
 * @return  self
 *
 * @since   3.6.3
 */
public function loadAll()
{
    $this->groups = array();
    $db = Factory::getDbo();
    $query = $db->getQuery(true)->select('*')->from($db->quoteName('#__usergroups'))->order($db->quoteName('lft') . ' ASC');
    $db->setQuery($query);
    $groups = $db->loadObjectList('id');
    $this->groups = $groups ?: array();
    $this->populateGroupsData();
    return $this;
}