final class ApiRecordCommentRepository implements RecordCommentRepositoryInterface (View source)

Record comment persistence for the API backend mode.

Uses PowerDNS REST API RRset comments as the sole storage backend. Comments are per-RRset (name + type), not per individual record. No database fallback - the API is the single source of truth.

Methods

__construct(PowerdnsApiClient $apiClient, ZoneReadBackendInterface $backendProvider)

No description

add(RecordComment $comment)

Add a new comment to the database.

bool
delete(int $domainId, string $name, string $type)

Delete all comments for an RRset (domain_id, name, type).

bool
deleteLegacyComment(int $domainId, string $name, string $type)

Delete only legacy RRset comments (no per-record links).

void
deleteByDomainId(int $domainId)

Delete all comments for a domain.

find(int $domainId, string $name, string $type)

Find a comment by RRset (domain_id, name, type).

update(int $domainId, string $oldName, string $oldType, RecordComment $comment)

Update an existing comment or create a new one.

addForRecord(int|string $recordId, RecordComment $comment)

Add a comment for a specific record.

Details

__construct(PowerdnsApiClient $apiClient, ZoneReadBackendInterface $backendProvider)

No description

Parameters

PowerdnsApiClient $apiClient
ZoneReadBackendInterface $backendProvider

RecordComment add(RecordComment $comment)

Add a new comment to the database.

Parameters

RecordComment $comment

The comment to add

Return Value

RecordComment

The added comment with ID

bool delete(int $domainId, string $name, string $type)

Delete all comments for an RRset (domain_id, name, type).

Parameters

int $domainId

Domain ID

string $name

Record name

string $type

Record type

Return Value

bool

bool deleteLegacyComment(int $domainId, string $name, string $type)

Delete only legacy RRset comments (no per-record links).

Parameters

int $domainId

Domain ID

string $name

Record name

string $type

Record type

Return Value

bool

void deleteByDomainId(int $domainId)

Delete all comments for a domain.

Parameters

int $domainId

Domain ID

Return Value

void

RecordComment|null find(int $domainId, string $name, string $type)

Find a comment by RRset (domain_id, name, type).

Returns the first matching comment.

Parameters

int $domainId

Domain ID

string $name

Record name

string $type

Record type

Return Value

RecordComment|null

RecordComment|null update(int $domainId, string $oldName, string $oldType, RecordComment $comment)

Update an existing comment or create a new one.

Parameters

int $domainId

Domain ID

string $oldName

Previous record name

string $oldType

Previous record type

RecordComment $comment

The updated comment

Return Value

RecordComment|null

RecordComment|null addForRecord(int|string $recordId, RecordComment $comment)

Add a comment for a specific record.

Creates the comment and links it to the record.

Parameters

int|string $recordId

The record ID

RecordComment $comment

The comment to add

Return Value

RecordComment|null

The added comment with ID, or null on failure