final class DbTemplateRecordLinkRepository implements TemplateRecordLinkRepositoryInterface (View source)

SQL persistence for records_zone_templ (numeric ids) and records_zone_templ_api (encoded ids).

Constants

private RECORD_COLUMNS

Methods

__construct(PDO $db, ConfigurationInterface $config, BackendCapabilitiesInterface $backend)

No description

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

__construct(PDO $db, ConfigurationInterface $config, BackendCapabilitiesInterface $backend)

No description

Parameters

PDO $db
ConfigurationInterface $config
BackendCapabilitiesInterface $backend

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