ZoneMetadataService
class ZoneMetadataService (View source)
The zone metadata rules the editor and the API share: what a kind accepts, who may change it, what the active backend can store, and how a change is persisted and logged. Callers parse their input and word the refusals.
Constants
| SUPPORT_SUPPORTED |
|
| SUPPORT_UNSUPPORTED_KNOWN |
|
| SUPPORT_UNKNOWN |
|
| MAX_KIND_LENGTH |
|
Methods
No description
Whether metadata lives in PowerDNS behind its API rather than in the database
No description
Trim the submitted rows and drop the ones with no kind or no content, so an add/remove-row editor never produces an empty write.
The kinds whose value set differs between two snapshots.
Why the active backend cannot store this kind (a MetadataDefinitions::REJECT_* code), or null.
Whether the connected server is known to take a version-gated kind: SUPPORT_* constants. The SQL backend stores anything.
The zone's metadata rows, sorted by kind. In API mode the zone-object properties that stand in for metadata kinds are folded in.
Replace the zone's whole metadata set, as the editor does. Every row is checked first, then only the kinds that actually change are gated, so a value set out of band does not lock the editor out of the rest.
Set every value of one kind, as the API does.
Remove every value of one kind, as the API does.
Details
__construct(ZoneRepositoryInterface $zoneRepository, ConfigurationInterface $config, PermissionService $permissions, AuditService $audit, RecordChangeLogger $changeLogger, PowerdnsApiClient|null $apiClient = null, LoggerInterface|null $logger = null)
No description
bool
isApiBackend()
Whether metadata lives in PowerDNS behind its API rather than in the database
static string
normalizeKind(string $kind)
No description
static array
normalizeRows(array $rows)
Trim the submitted rows and drop the ones with no kind or no content, so an add/remove-row editor never produces an empty write.
static array
changedKinds(array $submitted, array $current)
The kinds whose value set differs between two snapshots.
string|null
writeRejection(string $kind)
Why the active backend cannot store this kind (a MetadataDefinitions::REJECT_* code), or null.
string
kindSupport(array $definition, PdnsCapabilities $capabilities)
Whether the connected server is known to take a version-gated kind: SUPPORT_* constants. The SQL backend stores anything.
array
load(int $zoneId, string $zoneName)
The zone's metadata rows, sorted by kind. In API mode the zone-object properties that stand in for metadata kinds are folded in.
ZoneMetadataResult
replaceAll(int $zoneId, string $zoneName, array $rows, int $actingUserId)
Replace the zone's whole metadata set, as the editor does. Every row is checked first, then only the kinds that actually change are gated, so a value set out of band does not lock the editor out of the rest.
ZoneMetadataResult
replaceKind(int $zoneId, string $zoneName, string $kind, array $values, int $actingUserId)
Set every value of one kind, as the API does.
ZoneMetadataResult
deleteKind(int $zoneId, string $zoneName, string $kind, int $actingUserId)
Remove every value of one kind, as the API does.