Services\UserGroupManager::groupLists PHP Method

groupLists() public method

Get a list of all user groups
public groupLists ( string $value, key $key = null ) : array
$value string Value
$key key Key
return array
    public function groupLists($value, $key = null)
    {
        $groups = array();
        foreach (Sentry::findAllGroups() as $group) {
            if ($key) {
                $groups[$group->{$key}] = $group->{$value};
            } else {
                $groups[] = $group->{$value};
            }
        }
        return $groups;
    }