class ZoneTemplateSyncService (View source)

Service for managing zone template synchronization tracking

Methods

__construct(PDO $db, ConfigurationInterface $config, DnsBackendProvider|null $backendProvider = null)

No description

void
markTemplateAsModified(int $templateId)

Mark all zones using a template as needing sync

void
markZoneAsSynced(int $zoneId, int $templateId)

Mark a specific zone as synced with its template

void
markZonesAsSynced(array $zoneIds, int $templateId)

Mark multiple zones as synced

void
createSyncRecord(int $zoneId, int $templateId)

Create sync tracking record when zone is linked to template

void
removeSyncRecord(int $zoneId, int $templateId)

Remove sync tracking when zone is unlinked from template

void
removeStaleSyncRecords(int $zoneId, int $keepTemplateId)

Drop sync rows for prior templates so the table reflects the zone's current template.

void
cleanupZoneSyncRecords(int $zoneId)

Remove all sync tracking records for a zone when it's deleted

int
getUnsyncedZoneCount(int $templateId)

Get count of zones needing sync for a template

array
getTemplateSyncStatus(int|null $userId = null)

Get sync status for all templates

array
getUnsyncedZones(int $templateId)

Get list of zones needing sync for a template

bool
zoneNeedsSync(int $zoneId, int $templateId)

Check if a specific zone needs sync

void
initializeSyncRecords()

Initialize sync records for existing zone-template relationships

Details

__construct(PDO $db, ConfigurationInterface $config, DnsBackendProvider|null $backendProvider = null)

No description

Parameters

PDO $db
ConfigurationInterface $config
DnsBackendProvider|null $backendProvider

void markTemplateAsModified(int $templateId)

Mark all zones using a template as needing sync

Parameters

int $templateId

Return Value

void

void markZoneAsSynced(int $zoneId, int $templateId)

Mark a specific zone as synced with its template

Parameters

int $zoneId
int $templateId

Return Value

void

void markZonesAsSynced(array $zoneIds, int $templateId)

Mark multiple zones as synced

Parameters

array $zoneIds
int $templateId

Return Value

void

void createSyncRecord(int $zoneId, int $templateId)

Create sync tracking record when zone is linked to template

Parameters

int $zoneId
int $templateId

Return Value

void

void removeSyncRecord(int $zoneId, int $templateId)

Remove sync tracking when zone is unlinked from template

Parameters

int $zoneId
int $templateId

Return Value

void

void removeStaleSyncRecords(int $zoneId, int $keepTemplateId)

Drop sync rows for prior templates so the table reflects the zone's current template.

Pass 0 as $keepTemplateId to clear every sync row for the zone.

Parameters

int $zoneId
int $keepTemplateId

Return Value

void

void cleanupZoneSyncRecords(int $zoneId)

Remove all sync tracking records for a zone when it's deleted

Parameters

int $zoneId

Return Value

void

int getUnsyncedZoneCount(int $templateId)

Get count of zones needing sync for a template

Parameters

int $templateId

Return Value

int

array getTemplateSyncStatus(int|null $userId = null)

Get sync status for all templates

Parameters

int|null $userId

Return Value

array

array getUnsyncedZones(int $templateId)

Get list of zones needing sync for a template

Parameters

int $templateId

Return Value

array

bool zoneNeedsSync(int $zoneId, int $templateId)

Check if a specific zone needs sync

Parameters

int $zoneId
int $templateId

Return Value

bool

void initializeSyncRecords()

Initialize sync records for existing zone-template relationships

Return Value

void