interface RecordManagerInterface (View source)

Interface for DNS record management operations

Methods

bool
addRecord(int $zone_id, string $name, string $type, string $content, int $ttl, mixed $prio)

Add a record

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

editRecord(array $record, bool $finalizeZone = true, array|null $comment = null)

Edit a record. An unchanged save is skipped entirely when dns.bump_serial_on_unchanged_save is off, so nothing bumps the serial then.

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.

deleteRecord(int|string $rid, bool $finalizeZone = true)

Delete a record and everything that pointed at it (template link, comments)

static string
getZoneComment(PDO $db, int $zone_id)

Get Zone comment

bool
editZoneComment(int $zone_id, string $comment)

Edit the zone comment

Details

bool addRecord(int $zone_id, string $name, string $type, string $content, int $ttl, mixed $prio)

Add a record

Parameters

int $zone_id

Zone ID

string $name

Name part of record

string $type

Type of record

string $content

Content of record

int $ttl

Time-To-Live of record

mixed $prio

Priority of record

Return Value

bool

true if successful

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

Parameters

int $zone_id

Zone ID

string $name

Name part of record

string $type

Type of record

string $content

Content of record

int $ttl

Time-To-Live of record

mixed $prio

Priority of record

int $disabled

Whether the record is created in disabled state (0 or 1)

bool $finalizeZone

Bump the serial and rectify; a batch caller does that once itself

Return Value

RecordWriteResult

The new record id, or the reason the write was refused

RecordWriteResult editRecord(array $record, bool $finalizeZone = true, array|null $comment = null)

Edit a record. An unchanged save is skipped entirely when dns.bump_serial_on_unchanged_save is off, so nothing bumps the serial then.

Parameters

array $record

Record structure to update

bool $finalizeZone

Bump the serial and rectify; a batch caller does that once itself

array|null $comment

RRset comment ['content' => string, 'account' => string] to store with the record where the backend keeps them together

Return Value

RecordWriteResult

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.

Parameters

int $zoneId
bool $bumpSerial

Return Value

void

RecordWriteResult deleteRecord(int|string $rid, bool $finalizeZone = true)

Delete a record and everything that pointed at it (template link, comments)

Parameters

int|string $rid

Record ID

bool $finalizeZone

Bump the serial and rectify; a batch caller does that once itself

Return Value

RecordWriteResult

static string getZoneComment(PDO $db, int $zone_id)

Get Zone comment

Parameters

PDO $db

Database connection

int $zone_id

Zone ID

Return Value

string

Zone Comment

bool editZoneComment(int $zone_id, string $comment)

Edit the zone comment

Parameters

int $zone_id

Zone ID

string $comment

Comment to set

Return Value

bool

true on success