final class DbZoneGroupRepository implements ZoneGroupRepositoryInterface (View source)

SQL persistence for zone-to-group links in zones_groups; joins domains, or the zones table under the API backend.

Methods

__construct(PDO $db, ConfigurationInterface|null $config = null, bool $isApiBackend = false)

No description

void
lockZoneGroups(int $domainId)

Lock the zone's group rows for the rest of the open transaction, so a concurrent removal waits instead of deciding on stale group counts.

array
findByDomainId(int $domainId)

Find all groups that own a zone

array
findGroupIdsByDomainIds(array $domainIds)

Owning groups of several zones in one query, for list pages.

int
countGrantedZones(int $groupId)

Zones the group is granted, counting only grants that give access

array
findByGroupId(int $groupId)

Find all zones owned by a group

add(int $domainId, int $groupId)

Add a group as zone owner

bool
remove(int $domainId, int $groupId)

Remove a group from zone owners

void
removeAllForDomain(int $domainId)

Drop every group owner of a zone, when the zone is deleted.

bool
exists(int $domainId, int $groupId)

Check if a group owns a zone

Details

__construct(PDO $db, ConfigurationInterface|null $config = null, bool $isApiBackend = false)

No description

Parameters

PDO $db
ConfigurationInterface|null $config
bool $isApiBackend

void lockZoneGroups(int $domainId)

Lock the zone's group rows for the rest of the open transaction, so a concurrent removal waits instead of deciding on stale group counts.

Parameters

int $domainId

Return Value

void

array findByDomainId(int $domainId)

Find all groups that own a zone

Parameters

int $domainId

Return Value

array

array findGroupIdsByDomainIds(array $domainIds)

Owning groups of several zones in one query, for list pages.

Parameters

array $domainIds

Return Value

array

Zone id => group ids; zones without a group are absent

int countGrantedZones(int $groupId)

Zones the group is granted, counting only grants that give access

Parameters

int $groupId

Return Value

int

array findByGroupId(int $groupId)

Find all zones owned by a group

Parameters

int $groupId

Return Value

array

ZoneGroup add(int $domainId, int $groupId)

Add a group as zone owner

Parameters

int $domainId
int $groupId

Return Value

ZoneGroup

bool remove(int $domainId, int $groupId)

Remove a group from zone owners

Parameters

int $domainId
int $groupId

Return Value

bool

void removeAllForDomain(int $domainId)

Drop every group owner of a zone, when the zone is deleted.

Parameters

int $domainId

Return Value

void

bool exists(int $domainId, int $groupId)

Check if a group owns a zone

Parameters

int $domainId
int $groupId

Return Value

bool