interface DomainManagerInterface (View source)

Interface for domain/zone management operations

Methods

addDomain(object $db, string $domain, int|null $owner, string $type, string $slave_master, int|string $zone_template, array $groupIds = [], string|null $soaEditApi = null)

Add a domain to the database

deleteDomain(int $id)

Deletes a domain by a given id

changeZoneType(string $type, int $id)

Change Zone Type

bool
retrieveZone(int $id)

Ask the backend to retrieve a slave zone from its master now

changeZoneSlaveMaster(int $zone_id, string $ip_slave_master)

Change Slave Zone's Master IP Address

addOwnerToZone(int $zone_id, int $user_id)

Add a user as an owner of a zone; an existing owner counts as success

updateZoneRecords(string $db_type, int $dns_ttl, int $zone_id, int $zone_template_id)

Update All Zone Records for Zone ID with Zone Template

static int
getZoneTemplate(object $db, int $zone_id)

Get Zone Template ID for Zone ID

Details

ZoneWriteResult addDomain(object $db, string $domain, int|null $owner, string $type, string $slave_master, int|string $zone_template, array $groupIds = [], string|null $soaEditApi = null)

Add a domain to the database

Parameters

object $db

Database connection

string $domain

A domain name

int|null $owner

Owner ID for domain (null if only groups are assigned)

string $type

Type of domain ['NATIVE','MASTER','SLAVE']

string $slave_master

Master server hostname for domain

int|string $zone_template

ID of zone template ['none' or int]

array $groupIds

Group IDs for group ownership (assigned atomically within the same transaction)

string|null $soaEditApi

SOA-EDIT-API policy for the new zone; 'OFF' disables, null uses the dns.soa_edit_api config default

Return Value

ZoneWriteResult

ZoneWriteResult deleteDomain(int $id)

Deletes a domain by a given id

Parameters

int $id

Zone ID

Return Value

ZoneWriteResult

ZoneWriteResult changeZoneType(string $type, int $id)

Change Zone Type

Parameters

string $type

New Zone Type [NATIVE,MASTER,SLAVE]

int $id

Zone ID

Return Value

ZoneWriteResult

bool retrieveZone(int $id)

Ask the backend to retrieve a slave zone from its master now

Parameters

int $id

Zone ID

Return Value

bool

true on success

ZoneWriteResult changeZoneSlaveMaster(int $zone_id, string $ip_slave_master)

Change Slave Zone's Master IP Address

Parameters

int $zone_id

Zone ID

string $ip_slave_master

Master IP Address

Return Value

ZoneWriteResult

ZoneWriteResult addOwnerToZone(int $zone_id, int $user_id)

Add a user as an owner of a zone; an existing owner counts as success

Parameters

int $zone_id

Zone ID

int $user_id

User ID

Return Value

ZoneWriteResult

ZoneWriteResult updateZoneRecords(string $db_type, int $dns_ttl, int $zone_id, int $zone_template_id)

Update All Zone Records for Zone ID with Zone Template

Parameters

string $db_type

Database type

int $dns_ttl

Default TTL

int $zone_id

Zone ID to update

int $zone_template_id

Zone Template ID to use for update

Return Value

ZoneWriteResult

static int getZoneTemplate(object $db, int $zone_id)

Get Zone Template ID for Zone ID

Parameters

object $db

Database connection

int $zone_id

Zone ID

Return Value

int

Zone Template ID