interface UserGroupWriterInterface (View source)

Creating, updating and deleting groups, plus the counts that guard a delete.

Methods

save(UserGroup $group)

Save (create or update) a group

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

Details

UserGroup save(UserGroup $group)

Save (create or update) a group

Parameters

UserGroup $group

Return Value

UserGroup

bool delete(int $id)

Delete a group by ID

Parameters

int $id

Return Value

bool

array getMemberCountsByGroupIds(array $groupIds)

Get member counts for multiple groups in a single query

Parameters

array $groupIds

Return Value

array

Map of group_id => member_count

int countMembers(int $groupId)

Count members in a group

Parameters

int $groupId

Return Value

int

int countZones(int $groupId)

Count zones owned by a group

Parameters

int $groupId

Return Value

int

bool setZoneLimit(int $groupId, int|null $limit)

Set the group's own zone limit; null removes it so the configured default applies

Parameters

int $groupId
int|null $limit

Return Value

bool

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

Parameters

int $groupId

Return Value

void