SqlRecordRepository
class SqlRecordRepository implements RecordRepositoryInterface (View source)
SQL-backend record repository.
Queries PowerDNS tables directly via PDO.
Methods
Get Zone ID from Record ID
Count Zone Records for Zone ID
Get record details from Record ID
Get a Record from a Record ID
Get all records from a domain id.
Record ID to Domain ID
Check if record exists
Check if non-delegation records exist for a given name
Check if record has similar records with same name and type
Check if a record with the given parameters already exists
Get record ID by its attributes.
Check if any PTR record exists for a given reverse domain name
Get Serial for Zone ID
Get serial numbers for multiple zones in a single query
Get records by domain ID
Get the records at one name in a zone, optionally filtered by type.
Get filtered records from a domain with search capabilities
Get count of filtered records
Get the ID of a newly created record
Get a record by ID
Get all records in an RRset (matching domain, name, and type)
Details
__construct(PDO $db, ConfigurationInterface $config)
No description
int
getZoneIdFromRecordId(int|string $rid)
Get Zone ID from Record ID
int
countZoneRecords(int $zone_id)
Count Zone Records for Zone ID
array
getRecordDetailsFromRecordId(int|string $rid)
Get record details from Record ID
array|null
getRecordFromId(int|string $id)
Get a Record from a Record ID
Retrieve all fields of the record and send it back to the function caller.
array
getRecordsFromDomainId(string $db_type, int $id, int $rowstart = 0, int $rowamount = Constants::DEFAULT_MAX_ROWS, string $sortby = 'name', string $sortDirection = 'ASC', bool $fetchComments = false)
Get all records from a domain id.
Retrieve all fields of the records and send it back to the function caller.
int
recidToDomid(int|string $id)
Record ID to Domain ID
Gets the id of the domain by a given record id
bool
recordNameExists(string $name)
Check if record exists
bool
hasNonDelegationRecords(string $name)
Check if non-delegation records exist for a given name
Per RFC 1034: Delegation NS records are NOT authoritative data. Per RFC 4034: DS records are part of the delegation for DNSSEC. This method checks for records other than NS/DS which indicate authoritative data. Only delegation records (NS, DS) at a name should not prevent zone creation.
bool
hasSimilarRecords(int $domain_id, string $name, string $type, int|string $record_id)
Check if record has similar records with same name and type
bool
recordExists(int $domain_id, string $name, string $type, string $content)
Check if a record with the given parameters already exists
int|string|null
getRecordId(int $domain_id, string $name, string $type, string $content, int|null $prio = null, int|null $ttl = null)
Get record ID by its attributes.
bool
hasPtrRecord(int $domain_id, string $name)
Check if any PTR record exists for a given reverse domain name
string
getSerialByZid(int $zid)
Get Serial for Zone ID
array
getSerialsByZoneIds(array $zoneIds)
Get serial numbers for multiple zones in a single query
array
getRecordsByDomainId(int $domainId, string|null $recordType = null)
Get records by domain ID
array
getRecordsByName(int $domainId, string $name, string|null $type = null)
Get the records at one name in a zone, optionally filtered by type.
Prefer this over getRecordsByDomainId() whenever only one name matters: in API backend mode the zone-wide call fetches every record in the zone. Names match case-insensitively, per RFC 4343.
array
getFilteredRecords(int $zone_id, int $row_start, int $row_amount, string $sort_by, string $sort_direction, bool $include_comments, string $search_term = '', string $type_filter = '', string $content_filter = '')
Get filtered records from a domain with search capabilities
int
getFilteredRecordCount(int $zone_id, bool $include_comments, string $search_term = '', string $type_filter = '', string $content_filter = '')
Get count of filtered records
int|string|null
getNewRecordId(int $domainId, string $name, string $type, string $content)
Get the ID of a newly created record
array|null
getRecordById(int|string $recordId)
Get a record by ID
array
getRRSetRecords(int $domainId, string $name, string $type)
Get all records in an RRset (matching domain, name, and type)