class DnsDataService (View source)

Orchestration service for DNS data reads.

In SQL mode, delegates to existing repositories (zero behavioral change). In API mode, fetches DNS data from the PowerDNS API via DnsBackendProvider and enriches it with Poweradmin metadata (ownership, comments, templates) from SQL.

Methods

__construct(DnsBackendProvider $backendProvider, PDO $db, ConfigurationInterface $config)

No description

bool
isApiBackend()

Check if the API backend is active.

array
getForwardZones(string $perm, int $userId, string $letterStart, int $rowStart, int $rowAmount, string $sortBy, string $sortDirection, bool $showSerial = false, bool $showTemplate = false, bool $includeRecordCount = true)

Get forward zones with ownership, pagination, and optional enrichment.

array
getReverseZones(string $perm, int $userId, string $reverseType, int $offset, int $limit, string $sortBy, string $sortDirection, bool $showSerial = false, bool $showTemplate = false, bool $includeRecordCount = true)

Get reverse zones with ownership, pagination, and optional enrichment.

int
countZones(string $perm, string $letterStart = 'all', string $zoneType = 'forward')

Count zones matching criteria.

array
getReverseZoneCounts(string $perm, int $userId)

Get reverse zone counts (all, ipv4, ipv6) in a single call.

array
getDistinctStartingLetters(int $userId, bool $viewOthers)

Get distinct starting letters for forward zones.

array
getZoneRecords(int $zoneId, string $zoneName, int $rowStart, int $rowAmount, string $sortBy, string $sortDirection, bool $includeComments = false, string $searchTerm = '', string $typeFilter = '', string $contentFilter = '')

Get records for a zone.

array
searchZones(array $parameters, string $permissionView, string $sortBy, string $sortDirection, int $rowAmount, bool $includeComments, int $page)

Search zones.

int
searchZonesTotalCount(array $parameters, string $permissionView)

Get total count of matching zones for search.

array
searchRecords(array $parameters, string $permissionView, string $sortBy, string $sortDirection, bool $groupRecords, int $rowAmount, bool $includeComments, int $page)

Search records.

int
searchRecordsTotalCount(array $parameters, string $permissionView, bool $groupRecords)

Get total count of matching records for search.

Details

__construct(DnsBackendProvider $backendProvider, PDO $db, ConfigurationInterface $config)

No description

Parameters

DnsBackendProvider $backendProvider
PDO $db
ConfigurationInterface $config

bool isApiBackend()

Check if the API backend is active.

Return Value

bool

array getForwardZones(string $perm, int $userId, string $letterStart, int $rowStart, int $rowAmount, string $sortBy, string $sortDirection, bool $showSerial = false, bool $showTemplate = false, bool $includeRecordCount = true)

Get forward zones with ownership, pagination, and optional enrichment.

In SQL mode, delegates to DomainRepository::getZones(). In API mode, fetches from backend and enriches with Poweradmin metadata.

Parameters

string $perm

'own' or 'all'

int $userId

Current user ID

string $letterStart

Starting letter filter ('all', single letter, '1' for digits)

int $rowStart

Pagination offset

int $rowAmount

Rows per page

string $sortBy

Sort column

string $sortDirection

'ASC' or 'DESC'

bool $showSerial

Include SOA serial

bool $showTemplate

Include zone template name

bool $includeRecordCount

Return Value

array

Keyed by domain name, matching DomainRepository::getZones() shape

array getReverseZones(string $perm, int $userId, string $reverseType, int $offset, int $limit, string $sortBy, string $sortDirection, bool $showSerial = false, bool $showTemplate = false, bool $includeRecordCount = true)

Get reverse zones with ownership, pagination, and optional enrichment.

In SQL mode, delegates to DbZoneRepository::getReverseZones(). In API mode, fetches from backend and enriches with Poweradmin metadata.

Parameters

string $perm

'own' or 'all'

int $userId

Current user ID

string $reverseType

'all', 'ipv4', 'ipv6'

int $offset

Pagination offset

int $limit

Rows per page

string $sortBy

Sort column

string $sortDirection

'ASC' or 'DESC'

bool $showSerial

Include SOA serial

bool $showTemplate

Include zone template name

bool $includeRecordCount

Return Value

array

Keyed by domain name, matching DbZoneRepository::getReverseZones() shape

int countZones(string $perm, string $letterStart = 'all', string $zoneType = 'forward')

Count zones matching criteria.

In SQL mode, delegates to ZoneCountService::countZones(). In API mode, computes from the full zone list.

Parameters

string $perm

'own' or 'all'

string $letterStart

Starting letter filter

string $zoneType

'forward', 'reverse', or 'all'

Return Value

int

array getReverseZoneCounts(string $perm, int $userId)

Get reverse zone counts (all, ipv4, ipv6) in a single call.

In SQL mode, delegates to DbZoneRepository::getReverseZoneCounts(). In API mode, computes from the full zone list.

Parameters

string $perm

'own' or 'all'

int $userId

Current user ID

Return Value

array

array getDistinctStartingLetters(int $userId, bool $viewOthers)

Get distinct starting letters for forward zones.

In SQL mode, delegates to DbZoneRepository::getDistinctStartingLetters(). In API mode, computes from the full zone list.

Parameters

int $userId

Current user ID

bool $viewOthers

Whether user can view others' zones

Return Value

array

Unique starting letters

array getZoneRecords(int $zoneId, string $zoneName, int $rowStart, int $rowAmount, string $sortBy, string $sortDirection, bool $includeComments = false, string $searchTerm = '', string $typeFilter = '', string $contentFilter = '')

Get records for a zone.

In SQL mode, delegates to existing record repository methods. In API mode, fetches from backend with in-memory filtering/pagination.

Parameters

int $zoneId

Zone ID

string $zoneName

Zone name

int $rowStart

Pagination offset

int $rowAmount

Rows per page

string $sortBy

Sort column

string $sortDirection

'ASC' or 'DESC'

bool $includeComments

Include per-record comments

string $searchTerm

Search in name/content

string $typeFilter

Exact type match

string $contentFilter

Content substring search

Return Value

array

array searchZones(array $parameters, string $permissionView, string $sortBy, string $sortDirection, int $rowAmount, bool $includeComments, int $page)

Search zones.

In SQL mode, delegates to ZoneSearch. In API mode, uses DnsBackendProvider::searchDnsData() with enrichment.

Parameters

array $parameters
string $permissionView
string $sortBy
string $sortDirection
int $rowAmount
bool $includeComments
int $page

Return Value

array

int searchZonesTotalCount(array $parameters, string $permissionView)

Get total count of matching zones for search.

Parameters

array $parameters
string $permissionView

Return Value

int

array searchRecords(array $parameters, string $permissionView, string $sortBy, string $sortDirection, bool $groupRecords, int $rowAmount, bool $includeComments, int $page)

Search records.

In SQL mode, delegates to RecordSearch. In API mode, uses DnsBackendProvider::searchDnsData() with enrichment.

Parameters

array $parameters
string $permissionView
string $sortBy
string $sortDirection
bool $groupRecords
int $rowAmount
bool $includeComments
int $page

Return Value

array

int searchRecordsTotalCount(array $parameters, string $permissionView, bool $groupRecords)

Get total count of matching records for search.

Parameters

array $parameters
string $permissionView
bool $groupRecords

Return Value

int