interface ZoneReadRepositoryInterface (View source)

Zone lookups, lists and counts; one of the three roles ZoneRepositoryInterface combines.

Methods

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

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

Details

string|null getZoneComment(int $zoneId)

Get zone comment by zone ID

Parameters

int $zoneId

The zone ID

Return Value

string|null

The zone comment or null if not found

array|null getZoneById(int $zoneId)

Get a zone by ID

Parameters

int $zoneId

Zone ID

Return Value

array|null

Zone data if found, null otherwise

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.

Parameters

int $zoneId

The zone ID

Return Value

ZoneDetail|null

The zone or null if not found

array listZones(int|null $userId = null, bool $viewOthers = false, array $filters = [], int $offset = 0, int $limit = 100)

List zones with optional user/permission filtering

Parameters

int|null $userId

Optional user ID for filtering

bool $viewOthers

Whether user can view other users' zones

array $filters

Optional filters

int $offset

Pagination offset

int $limit

Maximum number of records

Return Value

array

Zones ordered by name

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

Parameters

array|null $zoneIds

Optional array of zone IDs to filter

int|null $userId

Optional user ID filter

string|null $nameFilter

Optional name filter

int|null $offset

Optional pagination offset

int|null $limit

Optional pagination limit

string|null $nameContains

Optional case-insensitive substring filter on the name

array $sort

Sort keys (name, type or id); empty keeps the name order

Return Value

array

Array of matching zones

int getZoneCount()

Get the total number of zones

Return Value

int

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

Parameters

array|null $zoneIds

Optional array of zone IDs to filter

int|null $userId

Optional user ID filter

string|null $nameFilter

Optional name filter

string|null $nameContains

Optional case-insensitive substring filter on the name

Return Value

int

Number of matching zones

array getDistinctStartingLetters(int $userId, bool $viewOthers)

No description

Parameters

int $userId
bool $viewOthers

Return Value

array

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

Parameters

string $permType

Permission type ('all', 'own')

int $userId

User ID (used when permType is 'own')

string $reverseType

Filter by reverse zone type ('all', 'ipv4', 'ipv6')

int $offset

Pagination offset

int $limit

Maximum number of records to return

string $sortBy

Column to sort by

string $sortDirection

Sort direction ('ASC' or 'DESC')

bool $countOnly

If true, returns only the count of matching zones

bool $showSerial
bool $showTemplate
bool $includeHealth
bool $includeRecordCount

Return Value

ZoneSummary>|int

Reverse zones keyed by name, or the count if countOnly is true

array getReverseZoneCounts(string $permType, int $userId)

Get all reverse zone counts in a single query (optimization)

Parameters

string $permType

Permission type ('all', 'own')

int $userId

User ID (used when permType is 'own')

Return Value

array

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.

Parameters

string $permType

Permission type ('all', 'own'); anything else counts nothing

int|null $userId

User ID for 'own'; null counts nothing

string $letterStart

Single first letter, '1' for a leading digit, 'idn' for punycode names, or 'all'

string $zoneType

'forward', 'reverse' or 'all'

Return Value

int

Number of matching zones

array findForwardZonesByPtrRecords(array $reverseZoneIds)

Find forward zones associated with reverse zones through PTR records

Parameters

array $reverseZoneIds

Array of reverse zone IDs

Return Value

array

Array of PTR record matches with forward zone information