class SqlDomainRepository implements DomainRepositoryInterface (View source)

SQL-backend domain repository.

Queries PowerDNS tables directly via PDO.

Methods

__construct(PDO $db, ConfigurationManager $config)

No description

int
zoneIdExists(int $zid)

Check if Zone ID exists

string|null
getDomainNameById(int $id)

Get Domain Name by domain ID

int|null
getDomainIdByName(string $name)

Get Domain ID by name

int|null
getZoneIdFromName(string $zname)

Get zone id from name

string
getDomainType(int $id)

Get Domain Type for Domain ID

string|null
getDomainSlaveMaster(int $id)

Get Slave Domain's Master

bool
domainExists(string $domain)

Check if a domain is already existing.

array
getZones(string $perm, int $userid = 0, string $letterstart = 'all', int $rowstart = 0, int $rowamount = Constants::DEFAULT_MAX_ROWS, string $sortby = 'name', string $sortDirection = 'ASC', bool $excludeReverse = false, bool|null $showSerial = null, bool|null $showTemplate = null, bool $includeHealth = true, bool $includeRecordCount = true)

Get Zones

array
getZoneInfoFromId(int $zid)

Get Zone details from Zone ID

array
getZoneInfoFromIds(array $zones)

Get Zone(s) details from Zone IDs

array
listZoneNames()

Every zone as a picker entry, sorted by name, regardless of who owns it.

int
getBestMatchingZoneIdFromName(string $domain)

Get Best Matching in-addr.arpa Zone ID from Domain Name

Details

__construct(PDO $db, ConfigurationManager $config)

No description

Parameters

PDO $db
ConfigurationManager $config

int zoneIdExists(int $zid)

Check if Zone ID exists

Parameters

int $zid

Zone ID

Return Value

int

Domain count or false on failure

string|null getDomainNameById(int $id)

Get Domain Name by domain ID

Parameters

int $id

Domain ID

Return Value

string|null

Domain name or null if not found

int|null getDomainIdByName(string $name)

Get Domain ID by name

Parameters

string $name

Domain name

Return Value

int|null

Domain ID or null if not found

int|null getZoneIdFromName(string $zname)

Get zone id from name

Parameters

string $zname

Zone name

Return Value

int|null

Zone ID or null if not found

string getDomainType(int $id)

Get Domain Type for Domain ID

Parameters

int $id

Domain ID

Return Value

string

Domain Type [NATIVE,MASTER,SLAVE]

string|null getDomainSlaveMaster(int $id)

Get Slave Domain's Master

Parameters

int $id

Domain ID

Return Value

string|null

Master server or null if not found

bool domainExists(string $domain)

Check if a domain is already existing.

Parameters

string $domain

Domain name

Return Value

bool

true if existing, false if it doesn't exist.

array getZones(string $perm, int $userid = 0, string $letterstart = 'all', int $rowstart = 0, int $rowamount = Constants::DEFAULT_MAX_ROWS, string $sortby = 'name', string $sortDirection = 'ASC', bool $excludeReverse = false, bool|null $showSerial = null, bool|null $showTemplate = null, bool $includeHealth = true, bool $includeRecordCount = true)

Get Zones

Parameters

string $perm

View Zone Permissions ['own','all','none']

int $userid

Requesting User ID

string $letterstart

Starting letters to match [default='all']

int $rowstart

Start from row in set [default=0]

int $rowamount

Max number of rows to fetch for this query when not 'all' [default=9999]

string $sortby

Column to sort results by [default='name']

string $sortDirection

Sort direction [default='ASC']

bool $excludeReverse
bool|null $showSerial
bool|null $showTemplate
bool $includeHealth
bool $includeRecordCount

Return Value

array

array of zone details [id,name,type,count_records] (empty array if none found)

array getZoneInfoFromId(int $zid)

Get Zone details from Zone ID

Parameters

int $zid

Zone ID

Return Value

array

array of zone details [type,name,master_ip,record_count]

array getZoneInfoFromIds(array $zones)

Get Zone(s) details from Zone IDs

Parameters

array $zones

Zone IDs

Return Value

array

array listZoneNames()

Every zone as a picker entry, sorted by name, regardless of who owns it.

Return Value

array

int getBestMatchingZoneIdFromName(string $domain)

Get Best Matching in-addr.arpa Zone ID from Domain Name

Parameters

string $domain

Domain name

Return Value

int

Zone ID