class ReadingMode (View source)

Converter helpers for versioned args

Methods

static array|null
toDataQueryParams(string $mode)

Convert reading mode string to dataquery params.

static string|null
fromDataQueryParams(array $params)

Converts dataquery params to original reading mode.

static string|null
fromQueryString(array|string $query)

Convert querystring arguments to reading mode.

static array
toQueryString(string $mode)

Build querystring arguments for current reading mode.

static 
validateStage(string $stage)

Validate the stage is valid, throwing an exception if it's not

Details

static array|null toDataQueryParams(string $mode)

Convert reading mode string to dataquery params.

Only supports stage / archive

Parameters

string $mode

Reading mode string

Return Value

array|null

static string|null fromDataQueryParams(array $params)

Converts dataquery params to original reading mode.

Only supports stage / archive

Parameters

array $params

Return Value

string|null

static string|null fromQueryString(array|string $query)

Convert querystring arguments to reading mode.

Only supports stage / archive mode

Parameters

array|string $query

Querystring arguments (array or string)

Return Value

string|null

Reading mode, or null if not found / supported

static array toQueryString(string $mode)

Build querystring arguments for current reading mode.

Supports stage / archive only.

Parameters

string $mode

Return Value

array

List of querystring arguments as an arry

static validateStage(string $stage)

Validate the stage is valid, throwing an exception if it's not

Parameters

string $stage