final class ApiRecordSearch extends ApiSearchBase implements RecordSearchInterface (View source)

Record search over the PowerDNS API, enriched with the zone owner from Poweradmin's zones table and filtered, sorted and paged in memory.

Constants

private SEARCH_LIMIT

private MAX_COMMENT_ZONES

Methods

__construct(PDO $db, DnsBackendProviderInterface $backendProvider, ZoneRepositoryInterface $zoneRepository, bool $recordCommentsEnabled = false, LoggerInterface|null $logger = null)

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
searchRecords(array $parameters, string $permissionView, int|null $userId, string $sortBy, string $sortDirection, bool $groupRecords, int $rowAmount, bool $includeComments, int $page)

No description

int
getTotalRecords(array $parameters, string $permissionView, int|null $userId, bool $groupRecords)

No description

bool
commentMatchesTruncated()

Whether the last searchRecords() call dropped comment matches because it hit the per-search zone cap.

Details

__construct(PDO $db, DnsBackendProviderInterface $backendProvider, ZoneRepositoryInterface $zoneRepository, bool $recordCommentsEnabled = false, LoggerInterface|null $logger = null)

No description

Parameters

PDO $db
DnsBackendProviderInterface $backendProvider
ZoneRepositoryInterface $zoneRepository
bool $recordCommentsEnabled
LoggerInterface|null $logger

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 searchRecords(array $parameters, string $permissionView, int|null $userId, string $sortBy, string $sortDirection, bool $groupRecords, int $rowAmount, bool $includeComments, int $page)

No description

Parameters

array $parameters

query, zones, records, comments, wildcard, reverse, type_filter, content_filter

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
bool $groupRecords

Collapse rows with the same name and content

int $rowAmount
bool $includeComments

Add the record comment to each row

int $page

Return Value

array

int getTotalRecords(array $parameters, string $permissionView, int|null $userId, bool $groupRecords)

No description

Parameters

array $parameters
string $permissionView
int|null $userId
bool $groupRecords

Return Value

int

bool commentMatchesTruncated()

Whether the last searchRecords() call dropped comment matches because it hit the per-search zone cap.

Return Value

bool