class TableNameService (View source)

Methods

__construct(ConfigurationInterface $config)

No description

string
getTable(PdnsTable $table)

Get table name with prefix using enum (preferred method)

array
getTables(PdnsTable ...$tables)

Get multiple table names at once using enums

string
validateOrderBy(string $column, array $allowedColumns)

Only ever returns a value present in $allowedColumns, so the result is safe to interpolate into ORDER BY.

string
validateDirection(string $direction)

Only ever returns 'ASC' or 'DESC', so the result is safe to interpolate.

int
validateLimit(int $limit, int $maxLimit = 10000)

No description

int
validateOffset(int $offset)

No description

Details

__construct(ConfigurationInterface $config)

No description

Parameters

ConfigurationInterface $config

string getTable(PdnsTable $table)

Get table name with prefix using enum (preferred method)

Parameters

PdnsTable $table

Table enum

Return Value

string

Full table name with prefix if configured

array getTables(PdnsTable ...$tables)

Get multiple table names at once using enums

Parameters

PdnsTable ...$tables

Variable number of table enums

Return Value

array

Array of full table names

string validateOrderBy(string $column, array $allowedColumns)

Only ever returns a value present in $allowedColumns, so the result is safe to interpolate into ORDER BY.

Parameters

string $column
array $allowedColumns

Return Value

string

string validateDirection(string $direction)

Only ever returns 'ASC' or 'DESC', so the result is safe to interpolate.

Parameters

string $direction

Return Value

string

int validateLimit(int $limit, int $maxLimit = 10000)

No description

Parameters

int $limit
int $maxLimit

Return Value

int

int validateOffset(int $offset)

No description

Parameters

int $offset

Return Value

int