class ReadingMode (View source)

Converter helpers for versioned args

Methods

public static 
array|null
toDataQueryParams(string $mode)

Convert reading mode string to dataquery params.

public static 
string|null
fromDataQueryParams(array $params)

Converts dataquery params to original reading mode.

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

Convert querystring arguments to reading mode.

public static 
array
toQueryString(string $mode)

Build querystring arguments for current reading mode.

public 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