interface UserGroupLookupInterface (View source)

Read access to user groups and their membership by user.

Methods

UserGroup|null
findById(int $id)

Find a group by ID

UserGroup|null
findByName(string $name)

Find a group by name

int|null
findIdByExactName(string $name)

Id of the group with exactly this name, accent-exact so an IdP-asserted claim cannot map to a look-alike group.

array
findAll()

Find all groups

array
findExistingIds(array $ids)

Return the subset of supplied IDs that actually exist in user_groups.

array
findByUserId(int $userId)

Find groups by user ID (groups the user belongs to)

array
findByUserIds(array $userIds)

Find the groups each of the supplied users belongs to

array
getGroupIdsForUser(int $userId)

Get the IDs of the groups the user belongs to

int
countAll()

Count all groups

Details

UserGroup|null findById(int $id)

Find a group by ID

Parameters

int $id

Return Value

UserGroup|null

UserGroup|null findByName(string $name)

Find a group by name

Parameters

string $name

Return Value

UserGroup|null

int|null findIdByExactName(string $name)

Id of the group with exactly this name, accent-exact so an IdP-asserted claim cannot map to a look-alike group.

Parameters

string $name

Return Value

int|null

array findAll()

Find all groups

Return Value

array

array findExistingIds(array $ids)

Return the subset of supplied IDs that actually exist in user_groups.

Parameters

array $ids

Return Value

array

array findByUserId(int $userId)

Find groups by user ID (groups the user belongs to)

Parameters

int $userId

Return Value

array

array findByUserIds(array $userIds)

Find the groups each of the supplied users belongs to

Parameters

array $userIds

Return Value

array

Keyed by user ID; users with no groups are absent

array getGroupIdsForUser(int $userId)

Get the IDs of the groups the user belongs to

Parameters

int $userId

Return Value

array

int countAll()

Count all groups

Return Value

int