class RecordDeletionService (View source)

Deletes a record and, when asked and when reverse handling is on, the PTR of an A/AAAA record or the A/AAAA of a PTR record. A selection of records is deleted the same way, with each affected zone finalized once.

Methods

__construct(RecordLookupInterface $recordRepository, RecordManagerInterface $recordManager, ReverseRecordCreator $reverseRecordCreator, AuditLoggerInterface $audit, bool $reverseHandling)

No description

deleteWithReverse(int $zoneId, int|string $recordId, bool $deletePtr, bool $deleteForward, Closure|null $companionZoneAllowed = null)

No description

deleteMany(array $recordIds, bool $deletePtr, Closure|null $companionZoneAllowed = null)

Deletes a selection that may span zones, then bumps and rectifies each affected zone once. A refused row is reported and the rest still go.

Details

__construct(RecordLookupInterface $recordRepository, RecordManagerInterface $recordManager, ReverseRecordCreator $reverseRecordCreator, AuditLoggerInterface $audit, bool $reverseHandling)

No description

Parameters

RecordLookupInterface $recordRepository
RecordManagerInterface $recordManager
ReverseRecordCreator $reverseRecordCreator
AuditLoggerInterface $audit
bool $reverseHandling

Whether the counterpart record is considered at all

RecordDeletionOutcome deleteWithReverse(int $zoneId, int|string $recordId, bool $deletePtr, bool $deleteForward, Closure|null $companionZoneAllowed = null)

No description

Parameters

int $zoneId
int|string $recordId

Numeric id, or the encoded identifier of an API-backed record

bool $deletePtr

Also remove the PTR of an A/AAAA record

bool $deleteForward

Also remove the A/AAAA of a PTR record

Closure|null $companionZoneAllowed

Whether the counterpart may be removed from its zone, which the caller did not check

Return Value

RecordDeletionOutcome

RecordBatchDeletionOutcome deleteMany(array $recordIds, bool $deletePtr, Closure|null $companionZoneAllowed = null)

Deletes a selection that may span zones, then bumps and rectifies each affected zone once. A refused row is reported and the rest still go.

Parameters

array $recordIds
bool $deletePtr

Also remove the PTR of each deleted A/AAAA record

Closure|null $companionZoneAllowed

Whether a PTR may be removed from its zone, which the caller did not check

Return Value

RecordBatchDeletionOutcome