final class ApiZoneSearch extends ApiSearchBase implements ZoneSearchInterface (View source)

Zone search over the PowerDNS API, enriched with owners and comments from Poweradmin's zones table and filtered, sorted and paged in memory.

Methods

__construct(PDO $db, DnsBackendProviderInterface $backendProvider, ZoneRepositoryInterface $zoneRepository)

No description

array
preprocessSearchQuery(array $parameters)

Punycode normalization and reverse IP expansion, matching what BaseSearch::buildSearchString() does for the SQL search.

array
ownedZoneIds(int $userId)

No description

array
keepOpenedZones(array $items, string $idKey, string $nameKey)

Drop the results of a zone whose canonical id another zone shares and opens (see SharedZoneIds).

string
canonicalZoneId(string $alias)

No description

array
searchZones(array $parameters, string $permissionView, int|null $userId, string $sortBy, string $sortDirection, int $rowAmount, bool $includeComments, int $page)

No description

int
getTotalZones(array $parameters, string $permissionView, int|null $userId)

Counts every match unpaged, so record counts stay off: they would cost an API call per matched zone only to be discarded.

Details

__construct(PDO $db, DnsBackendProviderInterface $backendProvider, ZoneRepositoryInterface $zoneRepository)

No description

Parameters

PDO $db
DnsBackendProviderInterface $backendProvider
ZoneRepositoryInterface $zoneRepository

protected array preprocessSearchQuery(array $parameters)

Punycode normalization and reverse IP expansion, matching what BaseSearch::buildSearchString() does for the SQL search.

Parameters

array $parameters

Return Value

array

protected array ownedZoneIds(int $userId)

No description

Parameters

int $userId

Return Value

array

protected array keepOpenedZones(array $items, string $idKey, string $nameKey)

Drop the results of a zone whose canonical id another zone shares and opens (see SharedZoneIds).

Parameters

array $items
string $idKey
string $nameKey

Return Value

array

protected string canonicalZoneId(string $alias)

No description

Parameters

string $alias

Return Value

string

array searchZones(array $parameters, string $permissionView, int|null $userId, string $sortBy, string $sortDirection, int $rowAmount, bool $includeComments, int $page)

No description

Parameters

array $parameters

query, zones, records, comments, wildcard, reverse

string $permissionView

'all', or 'own' to limit to zones $userId owns

int|null $userId

The user an 'own' view is limited to; null matches nothing

string $sortBy
string $sortDirection
int $rowAmount
bool $includeComments

Add the zone comment to each row

int $page

Return Value

array

int getTotalZones(array $parameters, string $permissionView, int|null $userId)

Counts every match unpaged, so record counts stay off: they would cost an API call per matched zone only to be discarded.

Parameters

array $parameters
string $permissionView
int|null $userId

Return Value

int