interface TemplateRecordLinkRepositoryInterface (View source)

Tracks which zone records a template application wrote, so a later application of the same template can remove exactly those records.

SQL backends key the link on the numeric records.id; the API backend keys it on the encoded record identifier and keeps it in a separate table.

Methods

void
linkRecord(int $zoneId, int|string $recordId, int $templateId)

Link a record the template just wrote to the template.

void
unlinkRecord(int|string $recordId)

Drop the link of one record, when the record itself is deleted.

void
unlinkZone(int $zoneId)

Drop every link of a zone, on both id spaces, when the zone is deleted.

array
removeLinkedRecords(int $zoneId, int $templateId)

Delete the records a template application wrote to a zone, and their links.

array
removeSoaRecords(int $zoneId)

Delete the apex SOA records of a zone so the template's SOA can replace them.

array
listEncodedLinks(int $zoneId, int $templateId)

Links a template application wrote on the API backend.

void
removeEncodedLinks(array $linkIds)

Drop API backend links by their row ids.

Details

void linkRecord(int $zoneId, int|string $recordId, int $templateId)

Link a record the template just wrote to the template.

Parameters

int $zoneId
int|string $recordId

Numeric id on SQL backends, encoded id on the API backend

int $templateId

Return Value

void

void unlinkRecord(int|string $recordId)

Drop the link of one record, when the record itself is deleted.

Parameters

int|string $recordId

Numeric id on SQL backends, encoded id on the API backend

Return Value

void

void unlinkZone(int $zoneId)

Drop every link of a zone, on both id spaces, when the zone is deleted.

Parameters

int $zoneId

Return Value

void

array removeLinkedRecords(int $zoneId, int $templateId)

Delete the records a template application wrote to a zone, and their links.

SQL backends only: the records are removed from the PowerDNS table directly.

Parameters

int $zoneId
int $templateId

Return Value

array

Rows (id, name, type, content, ttl, prio, disabled) of the removed records

array removeSoaRecords(int $zoneId)

Delete the apex SOA records of a zone so the template's SOA can replace them.

SQL backends only.

Parameters

int $zoneId

Return Value

array

Rows (id, name, type, content, ttl, prio, disabled) of the removed records

Links a template application wrote on the API backend.

Parameters

int $zoneId
int $templateId

Return Value

array

Rows (id, record_id) with the encoded record identifier

Drop API backend links by their row ids.

Parameters

array $linkIds

Return Value

void