GroupService
class GroupService (View source)
Service for managing user groups
Handles group CRUD operations, visibility filtering, and validation
Methods
array
listGroups(int $userId, bool $isAdmin)
List groups with visibility filtering
UserGroup|null
getGroupById(int $groupId, int $userId, bool $isAdmin)
Get a group by ID with visibility check
bool
canUserViewGroup(int $groupId, int $userId)
Check if a user can view a group
createGroup(string $name, int $permTemplId, string|null $description = null, int|null $createdBy = null)
Create a new group
updateGroup(int $groupId, string|null $name = null, string|null $description = null, int|null $permTemplId = null)
Update an existing group
bool
deleteGroup(int $groupId)
Delete a group
array
getGroupDetails(int $groupId)
Get group details including member and zone counts
bool
isGroupNameAvailable(string $name, int|null $excludeGroupId = null)
Check if a group name is available
Details
__construct(UserGroupRepositoryInterface $groupRepository)
No description
array
listGroups(int $userId, bool $isAdmin)
List groups with visibility filtering
UserGroup|null
getGroupById(int $groupId, int $userId, bool $isAdmin)
Get a group by ID with visibility check
bool
canUserViewGroup(int $groupId, int $userId)
Check if a user can view a group
UserGroup
createGroup(string $name, int $permTemplId, string|null $description = null, int|null $createdBy = null)
Create a new group
UserGroup
updateGroup(int $groupId, string|null $name = null, string|null $description = null, int|null $permTemplId = null)
Update an existing group
bool
deleteGroup(int $groupId)
Delete a group
Cascade deletes will remove all memberships and zone associations
array
getGroupDetails(int $groupId)
Get group details including member and zone counts
bool
isGroupNameAvailable(string $name, int|null $excludeGroupId = null)
Check if a group name is available