RecordManager
class RecordManager implements RecordManagerInterface (View source)
Service class for managing DNS records
Methods
Constructor
Add a record
Add a record and return its ID
Whether two stored copies of a record differ in any field that PowerDNS serves.
Edit a record
Delete a record by a given record id
What every single write ends with: bump the serial (unless told not to) and rectify. Batch callers pass finalizeZone=false to the writes and call this once when they are done; one holding a transaction bumps the serial inside it and calls this with bumpSerial=false after the commit, since PowerDNS rectifies from committed rows.
Edit the zone comment
Details
__construct(PDO $db, ConfigurationManager $config, DnsRecordValidationServiceInterface $validationService, SOARecordManagerInterface $soaRecordManager, DomainRepositoryInterface $domainRepository, DnsBackendProvider|null $backendProvider = null, LoggerInterface|null $logger = null, RecordChangeLogger|null $changeLogger = null, UserContextService|null $userContext = null)
Constructor
bool
addRecord(int $zone_id, string $name, string $type, string $content, int $ttl, mixed $prio)
Add a record
This function validates it if correct it inserts it into the database.
RecordWriteResult
addRecordGetId(int $zone_id, string $name, string $type, string $content, int $ttl, mixed $prio, int $disabled = 0, bool $finalizeZone = true)
Add a record and return its ID
This function validates and inserts a record into the database, returning the new record's ID for use with per-record comments.
static bool
recordFieldsDiffer(array $before, array $after)
Whether two stored copies of a record differ in any field that PowerDNS serves.
RecordWriteResult
editRecord(array $record, bool $finalizeZone = true, array|null $comment = null)
Edit a record
This function validates it if correct it inserts it into the database.
RecordWriteResult
deleteRecord(int|string $rid, bool $finalizeZone = true)
Delete a record by a given record id
void
finalizeZone(int $zoneId, bool $bumpSerial = true)
What every single write ends with: bump the serial (unless told not to) and rectify. Batch callers pass finalizeZone=false to the writes and call this once when they are done; one holding a transaction bumps the serial inside it and calls this with bumpSerial=false after the commit, since PowerDNS rectifies from committed rows.
static bool
deleteRecordZoneTempl(PDO $db, int|string $rid)
Delete record reference to zone template
static string
getZoneComment(PDO $db, int $zone_id)
Get Zone comment
bool
editZoneComment(int $zone_id, string $comment)
Edit the zone comment
This function validates it if correct it inserts it into the database.