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 DnsBackendProviderInterface 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 through the backend's search; an 'own' view is limited to the logged-in user's zones.
Get total count of matching zones for search.
Search records through the backend's search. Rows carry disabled as a bool
in both modes; an 'own' view is limited to the logged-in user's zones.
Get total count of matching records for search.
Whether the last record search listed only part of the comment matches (API backend zone cap).
Details
__construct(RepositoryFactory $repositoryFactory, DnsBackendProviderInterface $backendProvider, PDO $db, ActorInterface $actor, SessionInterface $session, AccountOwnerLookup|null $accountOwners = null, LoggerInterface|null $logger = null)
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.
Delegates to the zone repository through ZoneCountService.
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 through the backend's search; an 'own' view is limited to the logged-in user's 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 through the backend's search. Rows carry disabled as a bool
in both modes; an 'own' view is limited to the logged-in user's zones.
int
searchRecordsTotalCount(array $parameters, string $permissionView, bool $groupRecords)
Get total count of matching records for search.
bool
searchRecordsCommentsTruncated()
Whether the last record search listed only part of the comment matches (API backend zone cap).