Fetching Groups
$this->bitauth->get_groups()
Returns all groups. Each group object contains the following information:
| Attribute | Example | Description |
|---|---|---|
| group_id | 1 | Unique ID of this group. |
| name | Example Group | Name of the group. |
| description | This is an example group | Description of the group. |
| roles | 4 | Numeric representation of the group's roles. |
| members | array(1, 4, 15) | Array of user_ids for users who are members of this group. |
get_groups() returns an array of objects containing this information. You might iterate through all groups like:
$all_groups = $this->bitauth->get_groups();
foreach($all_groups as $group)
{
echo $group->name.'<br/>';
}
For information on checking a group's roles, see Checking Roles.
$this->bitauth->get_group_by_id($group_id)
Returns an object with the same information as get_groups() for one group, by group_id. Returns FALSE on failure.
$group = $this->bitauth->get_group_by_id(1);
if($group == FALSE)
{
echo 'Group Not Found';
}
else
{
echo 'Group Name: '.$group->name;
}
$this->bitauth->get_group_by_name($group_name)
Returns an object with the same information as get_groups() for one group, by name. $group_name is case-insensitive. Returns FALSE on failure.