RecordCommentService
class RecordCommentService (View source)
Service for managing DNS record comments.
Comments are stored per-record using a linking table (record_comment_links) that associates individual record IDs with comment IDs in the PowerDNS comments table. This allows different records with the same name and type to have different comments.
Methods
Create a comment for a specific record.
Create a comment for an RRset (legacy method).
Delete all comments for an RRset.
Delete legacy RRset comments that have no per-record links.
Delete comment for a specific record.
Delete all comments for a domain.
Update a comment for a specific record.
Update a comment for an RRset when name/type changes (legacy method).
Find a comment for an RRset.
Find a comment for a specific record.
Details
__construct(RecordCommentRepositoryInterface $recordCommentRepository)
No description
RecordComment|null
createCommentForRecord(int $domainId, string $name, string $type, string $comment, int|string $recordId, string|null $account = null)
Create a comment for a specific record.
Uses the linking table for per-record comment storage.
RecordComment|null
createComment(int $domainId, string $name, string $type, string $comment, string|null $account = null)
Create a comment for an RRset (legacy method).
This does NOT use the linking table - use createCommentForRecord() for per-record comments.
bool
deleteComment(int $domainId, string $name, string $type)
Delete all comments for an RRset.
Also removes any links pointing to those comments.
bool
deleteLegacyComment(int $domainId, string $name, string $type)
Delete legacy RRset comments that have no per-record links.
bool
deleteCommentByRecordId(int|string $recordId)
Delete comment for a specific record.
Removes the link and the associated comment.
void
deleteCommentsByDomainId(int $domainId)
Delete all comments for a domain.
RecordComment|null
updateCommentForRecord(int $domainId, string $name, string $type, string $comment, int|string $recordId, string|null $account = null)
Update a comment for a specific record.
Uses the linking table for per-record comment storage.
RecordComment|null
updateComment(int $domainId, string $oldName, string $oldType, string $newName, string $newType, string $comment, string|null $account = null)
Update a comment for an RRset when name/type changes (legacy method).
RecordComment|null
findComment(int $domainId, string $name, string $type)
Find a comment for an RRset.
RecordComment|null
findCommentByRecordId(int|string $recordId)
Find a comment for a specific record.