DnsDataService
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
No description
Check if the API backend is active.
Get forward zones with ownership, pagination, and optional enrichment.
Get reverse zones with ownership, pagination, and optional enrichment.
Count zones matching criteria.
Get reverse zone counts (all, ipv4, ipv6) in a single call.
Get distinct starting letters for forward zones.
Get records for a zone.
Search zones.
Get total count of matching zones for search.
Search records.
Get total count of matching records for search.
Details
__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.
In SQL mode, delegates to DomainRepository::getZones(). In API mode, fetches from backend and enriches with Poweradmin metadata.
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.
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.
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.
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.
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.
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.
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.
In SQL mode, delegates to RecordSearch. In API mode, uses DnsBackendProvider::searchDnsData() with enrichment.
int
searchRecordsTotalCount(array $parameters, string $permissionView, bool $groupRecords)
Get total count of matching records for search.