DbZoneRepository
class DbZoneRepository implements ZoneRepositoryInterface (View source)
Methods
No description
Get reverse zones with efficient database-level filtering and pagination
Get all reverse zone counts in a single query (optimization)
Get domain name by ID
Get a complete list of zones accessible by the current user
Check if a zone exists and is accessible by a user
Get a zone by ID with full details
Get a zone by name with full details
Find forward zones associated with reverse zones through PTR records
Check if zone exists by ID
Get domain type by zone ID
Get slave master by zone ID
Get zone comment by zone ID
Update zone comment
Get users who own a zone
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.
Add owner to zone
Remove owner from zone
Check if user is already an owner of the zone
Get zone ID by name
Get raw PowerDNS domain metadata rows for a zone.
Replace all PowerDNS domain metadata rows for a zone.
Delete a zone by ID
Update zone metadata
Get all zones with pagination
Get the total number of zones
Get count of zones filtered by zone IDs (permission-aware)
Get all zones filtered by zone IDs (permission-aware)
Get a zone by ID
Details
__construct($db, $config, DnsBackendProvider|null $backendProvider = null)
No description
array
getDistinctStartingLetters(int $userId, bool $viewOthers)
No description
array|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)
string|null
getDomainNameById(int $zoneId)
Get domain name by ID
array
listZones(int|null $userId = null, bool $viewOthers = false, array $filters = [], int $offset = 0, int $limit = 100)
Get a complete list of zones accessible by the current user
bool
zoneExists(int $zoneId, int|null $userId = null)
Check if a zone exists and is accessible by a user
array|null
getZone(int $zoneId)
Get a zone by ID with full details
array|null
getZoneByName(string $zoneName)
Get a zone by name with full details
array
findForwardZonesByPtrRecords(array $reverseZoneIds)
Find forward zones associated with reverse zones through PTR records
Optimized 3-step approach instead of slow LIKE JOIN:
- Fetch all PTR records for reverse zones
- Extract domain suffixes from PTR content in PHP
- Look up forward zones with exact IN() match (uses indexes)
bool
zoneIdExists(int $zoneId)
Check if zone exists by ID
string
getDomainType(int $zoneId)
Get domain type by zone ID
string|null
getDomainSlaveMaster(int $zoneId)
Get slave master by zone ID
string|null
getZoneComment(int $zoneId)
Get zone comment by zone ID
bool
updateZoneComment(int $zoneId, string $comment)
Update zone comment
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.
bool
addOwnerToZone(int $zoneId, int $userId)
Add owner to zone
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
int|null
getZoneIdByName(string $zoneName)
Get zone ID by name
array
getDomainMetadata(int $zoneId)
Get raw PowerDNS domain metadata rows for a zone.
bool
replaceDomainMetadata(int $zoneId, array $metadata)
Replace all PowerDNS domain metadata rows for a zone.
bool
deleteZone(int $zoneId)
Delete a zone by ID
bool
updateZone(int $zoneId, array $updates)
Update zone metadata
array
getAllZones(int|null $offset = null, int|null $limit = null)
Get all zones with pagination
int
getZoneCount()
Get the total number of zones
int
getZoneCountFiltered(array|null $zoneIds, int|null $userId = null, string|null $nameFilter = null)
Get count of zones filtered by zone IDs (permission-aware)
array
getAllZonesFiltered(array|null $zoneIds, int|null $userId = null, string|null $nameFilter = null, int|null $offset = null, int|null $limit = null)
Get all zones filtered by zone IDs (permission-aware)
array|null
getZoneById(int $zoneId)
Get a zone by ID