UserGroupRepositoryInterface
interface UserGroupRepositoryInterface implements UserGroupLookupInterface, UserGroupWriterInterface (View source)
Persistence for user groups.
Union of the UserGroupRepositoryInterface roles; consumers should depend on the narrowest role they use.
Methods
Id of the group with exactly this name, accent-exact so an IdP-asserted claim cannot map to a look-alike group.
Return the subset of supplied IDs that actually exist in user_groups.
Find groups by user ID (groups the user belongs to)
Find the groups each of the supplied users belongs to
Get the IDs of the groups the user belongs to
Get member counts for multiple groups in a single query
Set the group's own zone limit; null removes it so the configured default applies
Lock the group's row until the open transaction ends, so zone limit checks for this group run one at a time
Details
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
bool
delete(int $id)
Delete a group by ID
array
getMemberCountsByGroupIds(array $groupIds)
Get member counts for multiple groups in a single query
int
countMembers(int $groupId)
Count members in a group
int
countZones(int $groupId)
Count zones owned by a group
bool
setZoneLimit(int $groupId, int|null $limit)
Set the group's own zone limit; null removes it so the configured default applies
void
lockForZoneLimit(int $groupId)
Lock the group's row until the open transaction ends, so zone limit checks for this group run one at a time