class ZoneEditService (View source)

Saves the zone editor's record table: the edit gate, the stale-form check, the per-row diff and write, the record and zone comments, and the SOA serial bump that closes a save.

Methods

__construct(ConfigurationInterface $config, PermissionService $permissions, ZoneRepositoryInterface $zones, DomainRepositoryInterface $domains, RecordLookupInterface $records, RecordManagerInterface $recordManager, SOARecordManagerInterface $soaRecords, RecordCommentEditorInterface $comments, RecordCommentSyncInterface $commentSync, AuditLoggerInterface $audit, bool $recordCommentsEnabled, bool $zoneCommentsEnabled, TransactionInterface|null $transaction = null)

No description

void
holdAudit()

Holds the audit lines of the rows written from now on until releaseAudit(), so the lines of a save that is rolled back never reach the log.

void
releaseAudit(bool $committed)

Writes the held audit lines when the transaction committed, drops them otherwise, and stops holding.

save(ZoneEditSubmission $submission)

No description

array
vacatedRecords(array $changes)

Previews each change and collects the stored content of the records that pass validation and really move away from an RRset another change in the same save writes to. The writes run one by one, so a swap would otherwise be refused as a copy. The caller writes them in one transaction and rolls back on any refusal; a save with no such overlap gets an empty set and keeps saving row by row.

diffRow(ZoneEditSubmission $submission, ZoneEditRow $row)

Normalises one row and compares it with the zone, writing nothing.

writeRow(ZoneEditSubmission $submission, ZoneEditRowChange $change, array $vacated = [])

Writes one changed row without bumping the serial: the record, its audit line, and the record comment with its PTR/A sync when comments are shown.

Details

__construct(ConfigurationInterface $config, PermissionService $permissions, ZoneRepositoryInterface $zones, DomainRepositoryInterface $domains, RecordLookupInterface $records, RecordManagerInterface $recordManager, SOARecordManagerInterface $soaRecords, RecordCommentEditorInterface $comments, RecordCommentSyncInterface $commentSync, AuditLoggerInterface $audit, bool $recordCommentsEnabled, bool $zoneCommentsEnabled, TransactionInterface|null $transaction = null)

No description

Parameters

ConfigurationInterface $config
PermissionService $permissions
ZoneRepositoryInterface $zones
DomainRepositoryInterface $domains
RecordLookupInterface $records
RecordManagerInterface $recordManager
SOARecordManagerInterface $soaRecords
RecordCommentEditorInterface $comments
RecordCommentSyncInterface $commentSync
AuditLoggerInterface $audit
bool $recordCommentsEnabled

Whether record comments are edited and stored with a save

bool $zoneCommentsEnabled

Whether the zone comment is stored with a save

TransactionInterface|null $transaction

The local write transaction, when the backend has one; without it a save never moves records into each other's place

void holdAudit()

Holds the audit lines of the rows written from now on until releaseAudit(), so the lines of a save that is rolled back never reach the log.

Return Value

void

void releaseAudit(bool $committed)

Writes the held audit lines when the transaction committed, drops them otherwise, and stops holding.

Parameters

bool $committed

Return Value

void

ZoneSaveResult save(ZoneEditSubmission $submission)

No description

Parameters

ZoneEditSubmission $submission

Return Value

ZoneSaveResult

array vacatedRecords(array $changes)

Previews each change and collects the stored content of the records that pass validation and really move away from an RRset another change in the same save writes to. The writes run one by one, so a swap would otherwise be refused as a copy. The caller writes them in one transaction and rolls back on any refusal; a save with no such overlap gets an empty set and keeps saving row by row.

Parameters

array $changes

Return Value

array

Stored content by record id

ZoneEditRowChange|null diffRow(ZoneEditSubmission $submission, ZoneEditRow $row)

Normalises one row and compares it with the zone, writing nothing.

A change request files what this reports and replays it through writeRow().

Parameters

ZoneEditSubmission $submission
ZoneEditRow $row

Return Value

ZoneEditRowChange|null

The change, or null when the row matched the zone

RecordWriteResult writeRow(ZoneEditSubmission $submission, ZoneEditRowChange $change, array $vacated = [])

Writes one changed row without bumping the serial: the record, its audit line, and the record comment with its PTR/A sync when comments are shown.

Parameters

ZoneEditSubmission $submission
ZoneEditRowChange $change
array $vacated

Stored content by id of the records the same save moves away

Return Value

RecordWriteResult