RecordManagerInterface
interface RecordManagerInterface (View source)
Record creation, update and deletion.
Methods
Add a record
Add a record and return its ID
Edit a record. An unchanged save is skipped entirely when dns.bump_serial_on_unchanged_save is off, so nothing bumps the serial then; the result then reports changed = false.
Runs an edit's permission checks and validation, but not the duplicate check, and writes nothing. A save that moves several records first previews each one: only a record that passes and really moves goes into the vacated set of the real writes.
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. $rrsetWritten is false when nothing was sent to the backend (no-op save, zone comment), so the API backend bumps the serial itself.
Delete a record and everything that pointed at it (template link, comments)
Edit the zone comment
Details
bool
addRecord(int $zone_id, string $name, string $type, string $content, int $ttl, mixed $prio)
Add a record
RecordWriteResult
addRecordGetId(int $zone_id, string $name, string $type, string $content, int $ttl, mixed $prio, int $disabled = 0, bool $finalizeZone = true, array|null $comment = null, bool $dryRun = false, array $vacated = [])
Add a record and return its ID
RecordWriteResult
editRecord(array $record, bool $finalizeZone = true, array|null $comment = null, bool $dryRun = false, array $vacated = [])
Edit a record. An unchanged save is skipped entirely when dns.bump_serial_on_unchanged_save is off, so nothing bumps the serial then; the result then reports changed = false.
RecordWriteResult
previewEdit(array $record)
Runs an edit's permission checks and validation, but not the duplicate check, and writes nothing. A save that moves several records first previews each one: only a record that passes and really moves goes into the vacated set of the real writes.
void
finalizeZone(int $zoneId, bool $bumpSerial = true, bool $rrsetWritten = 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. $rrsetWritten is false when nothing was sent to the backend (no-op save, zone comment), so the API backend bumps the serial itself.
RecordWriteResult
deleteRecord(int|string $rid, bool $finalizeZone = true, bool $dryRun = false)
Delete a record and everything that pointed at it (template link, comments)
RecordWriteResult
editZoneComment(int $zone_id, string $comment)
Edit the zone comment