ZoneRepositoryInterface
interface ZoneRepositoryInterface implements ZoneReadRepositoryInterface, ZoneOwnershipRepositoryInterface, ZoneWriteRepositoryInterface (View source)
Zone reads and ownership writes; implemented for SQL and for the API backend mode.
Methods
Get zone comment by zone ID
Get a zone by ID with full details
List zones with optional user/permission filtering
Get all zones with filtering and pagination
Get count of zones with filtering
No description
Get reverse zones with efficient database-level filtering and pagination
Get all reverse zone counts in a single query (optimization)
Count the zones a permission scope may see, optionally narrowed by first letter and zone kind.
Find forward zones associated with reverse zones through PTR records
Direct owners of several zones in one query, for list pages.
Ids of every zone the user owns directly or through a group, in the id space the zone logs and zones_groups use.
Lock the zone's owner rows for the rest of the open transaction, so a concurrent removal waits instead of deciding on stale owner counts.
Add owner to zone
Give the named zone row a user being deleted holds to another user, so the zone stays.
Remove owner from zone
Check if user is already an owner of the zone
Whether two zones share this zone id in API backend mode, so owner rows and group grants keyed by it cannot tell the zones apart and are not honoured.
Write the native zones row of a zone the backend has just created.
Drop the native zones row of a zone, when the zone is deleted.
Set the zone comment, creating the zones row for a zone that has none.
Update zone comment
Details
string|null
getZoneComment(int $zoneId)
Get zone comment by zone ID
array|null
getZoneById(int $zoneId)
Get a zone by ID
ZoneDetail|null
getZone(int $zoneId)
Get a zone by ID with full details
The getZoneById() core plus comment, secured and the owner list; ZoneDetail::toArray() gives the legacy column-keyed shape.
array
listZones(int|null $userId = null, bool $viewOthers = false, array $filters = [], int $offset = 0, int $limit = 100)
List zones with optional user/permission filtering
array
getAllZonesFiltered(array|null $zoneIds, int|null $userId = null, string|null $nameFilter = null, int|null $offset = null, int|null $limit = null, string|null $nameContains = null, array $sort = [])
Get all zones with filtering and pagination
int
getZoneCount()
Get the total number of zones
int
getZoneCountFiltered(array|null $zoneIds, int|null $userId = null, string|null $nameFilter = null, string|null $nameContains = null)
Get count of zones with filtering
array
getDistinctStartingLetters(int $userId, bool $viewOthers)
No description
ZoneSummary>|int
getReverseZones(string $permType, int $userId, string $reverseType = 'all', int $offset = 0, int $limit = 25, string $sortBy = 'name', string $sortDirection = 'ASC', bool $countOnly = false, bool $showSerial = false, bool $showTemplate = false, bool $includeHealth = true, bool $includeRecordCount = true)
Get reverse zones with efficient database-level filtering and pagination
array
getReverseZoneCounts(string $permType, int $userId)
Get all reverse zone counts in a single query (optimization)
int
countZones(string $permType, int|null $userId, string $letterStart = 'all', string $zoneType = 'forward')
Count the zones a permission scope may see, optionally narrowed by first letter and zone kind.
array
findForwardZonesByPtrRecords(array $reverseZoneIds)
Find forward zones associated with reverse zones through PTR records
array
getZoneOwners(int $zoneId)
Get users who own a zone
array
getOwnerIdsByZoneIds(array $zoneIds)
Direct owners of several zones in one query, for list pages.
array
getOwnedZoneIds(int $userId)
Ids of every zone the user owns directly or through a group, in the id space the zone logs and zones_groups use.
void
lockZoneOwners(int $zoneId)
Lock the zone's owner rows for the rest of the open transaction, so a concurrent removal waits instead of deciding on stale owner counts.
bool
addOwnerToZone(int $zoneId, int $userId)
Add owner to zone
bool|null
handOverNamedZoneRow(int $zoneId, int $fromUserId, int $toUserId)
Give the named zone row a user being deleted holds to another user, so the zone stays.
Null when the backend keeps no such row or the user holds none (add an owner instead); false when the id is shared and the row it opens is not that user's.
bool
removeOwnerFromZone(int $zoneId, int $userId)
Remove owner from zone
bool
isUserZoneOwner(int $zoneId, int $userId)
Check if user is already an owner of the zone
bool
isSharedZoneId(int $zoneId)
Whether two zones share this zone id in API backend mode, so owner rows and group grants keyed by it cannot tell the zones apart and are not honoured.
int|string
createZoneShell(int $domainId, int|null $owner, int $templateId)
Write the native zones row of a zone the backend has just created.
void
deleteZoneShell(int $domainId)
Drop the native zones row of a zone, when the zone is deleted.
void
saveZoneComment(int $zoneId, string $comment)
Set the zone comment, creating the zones row for a zone that has none.
bool
updateZoneComment(int $zoneId, string $comment)
Update zone comment
bool
updateZone(int $zoneId, array $updates)
Update zone metadata
bool
deleteZone(int $zoneId)
Delete a zone by ID