ApiRecordCommentRepository
class ApiRecordCommentRepository implements RecordCommentRepositoryInterface (View source)
API-backend record comment repository.
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
Delete all comments for an RRset (domain_id, name, type).
Delete only legacy RRset comments (no per-record links).
Delete all comments for a domain.
Find a comment by RRset (domain_id, name, type).
Update an existing comment or create a new one.
Find a comment linked to a specific record ID.
Delete the comment linked to a specific record ID.
Link a record to a comment.
Unlink a record from its comment.
Migrate legacy RRset comments to per-record links for all records in the RRset that don't have linked comments yet.
Details
__construct(PowerdnsApiClient $apiClient, DnsBackendProvider $backendProvider)
No description
RecordComment
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.
RecordComment|null
find(int $domainId, string $name, string $type)
Find a comment by RRset (domain_id, name, type).
Returns the first matching comment.
RecordComment|null
update(int $domainId, string $oldName, string $oldType, RecordComment $comment)
Update an existing comment or create a new one.
RecordComment|null
findByRecordId(int|string $recordId)
Find a comment linked to a specific record ID.
bool
deleteByRecordId(int|string $recordId)
Delete the comment linked to a specific record ID.
bool
linkRecordToComment(int|string $recordId, int $commentId)
Link a record to a comment.
bool
unlinkRecord(int|string $recordId)
Unlink a record from its comment.
RecordComment|null
addForRecord(int|string $recordId, RecordComment $comment)
Add a comment for a specific record.
Creates the comment and links it to the record.
bool
migrateLegacyComments(int $domainId, string $name, string $type, int|string $excludeRecordId)
Migrate legacy RRset comments to per-record links for all records in the RRset that don't have linked comments yet.