class ZoneGroupService (View source)

Service for managing zone-group ownership

Handles assigning groups as zone owners

Methods

__construct(ZoneGroupRepositoryInterface $zoneGroupRepository, UserGroupRepositoryInterface $groupRepository)

No description

addGroupToZone(int $domainId, int $groupId)

Add a group as zone owner

bool
removeGroupFromZone(int $domainId, int $groupId)

Remove a group from zone owners

array
listZoneOwners(int $domainId)

List all groups that own a zone

array
listGroupZones(int $groupId)

List all zones owned by a group

array
bulkAddZones(int $groupId, array $domainIds)

Add multiple zones to a group

array
bulkRemoveZones(int $groupId, array $domainIds)

Remove multiple zones from a group

bool
isGroupOwner(int $domainId, int $groupId)

Check if a group owns a zone

array
getGroupDeletionImpact(int $groupId, int $limit = 20)

Get zones that will be affected when a group is deleted

Details

__construct(ZoneGroupRepositoryInterface $zoneGroupRepository, UserGroupRepositoryInterface $groupRepository)

No description

Parameters

ZoneGroupRepositoryInterface $zoneGroupRepository
UserGroupRepositoryInterface $groupRepository

ZoneGroup addGroupToZone(int $domainId, int $groupId)

Add a group as zone owner

Parameters

int $domainId

Zone/Domain ID

int $groupId

Group ID

Return Value

ZoneGroup

Exceptions

InvalidArgumentException

bool removeGroupFromZone(int $domainId, int $groupId)

Remove a group from zone owners

Note: Zones can exist without any owners

Parameters

int $domainId

Zone/Domain ID

int $groupId

Group ID

Return Value

bool

Exceptions

InvalidArgumentException

array listZoneOwners(int $domainId)

List all groups that own a zone

Parameters

int $domainId

Zone/Domain ID

Return Value

array

array listGroupZones(int $groupId)

List all zones owned by a group

Parameters

int $groupId

Group ID

Return Value

array

Exceptions

InvalidArgumentException

array bulkAddZones(int $groupId, array $domainIds)

Add multiple zones to a group

Parameters

int $groupId

Group ID

array $domainIds

Array of domain IDs

Return Value

array

Results of bulk operation

array bulkRemoveZones(int $groupId, array $domainIds)

Remove multiple zones from a group

Parameters

int $groupId

Group ID

array $domainIds

Array of domain IDs

Return Value

array

Results of bulk operation

bool isGroupOwner(int $domainId, int $groupId)

Check if a group owns a zone

Parameters

int $domainId

Zone/Domain ID

int $groupId

Group ID

Return Value

bool

array getGroupDeletionImpact(int $groupId, int $limit = 20)

Get zones that will be affected when a group is deleted

Parameters

int $groupId

Group ID

int $limit

Limit number of zones returned (default 20)

Return Value

array