Documentation

Request
in package

Request basic class.

Table of Contents

$headersPurifierMap  : array<string|int, mixed>
List of headings and sanitization methods.
$headers  : array<string|int, mixed>
Headers request.
$purifiedValuesByArray  : array<string|int, mixed>
Purified request values for array.
$purifiedValuesByDateRange  : array<string|int, mixed>
Purified request values for date range.
$purifiedValuesByExploded  : array<string|int, mixed>
Purified request values for exploded.
$purifiedValuesByGet  : array<string|int, mixed>
Purified request values for get.
$purifiedValuesByHtml  : array<string|int, mixed>
Purified request values for date html.
$purifiedValuesByInteger  : array<string|int, mixed>
Purified request values for integer.
$purifiedValuesByMultiDimension  : array<string|int, mixed>
Purified request values for multi dimension array.
$purifiedValuesByType  : array<string|int, mixed>
Purified request values for type.
$rawValues  : array<string|int, mixed>
Raw request data.
$request  : Request
Self instance.
__callStatic()  : mixed
Support static methods, all functions must start with "_".
__construct()  : mixed
Constructor.
delete()  : mixed
Function to remove the value for a given key.
get()  : mixed
Function to get the value for a given key.
getAll()  : array<string|int, mixed>
Get all data.
getAllRaw()  : array<string|int, mixed>
Get all raw data.
getArray()  : array<string|int, mixed>
Function to get the array values for a given key.
getBoolean()  : bool
Function to get the boolean value for a given key.
getByType()  : bool|mixed
Purify by data type.
getDateRange()  : array<string|int, mixed>
Function to get the date range values for a given key.
getExploded()  : array<string|int, mixed>
Function to get the exploded values for a given key.
getForHtml()  : mixed
Function to get html the value for a given key.
getForSql()  : string
Function to get the value if its safe to use for SQL Query (column).
getHeader()  : string
Get header for a given key.
getHeaders()  : array<string|int, string>
Get all headers.
getInteger()  : int
Function to get the integer value for a given key.
getKeys()  : array<string|int, mixed>
Get all request keys.
getMode()  : string
Function to get the request mode.
getModule()  : string
Get module name.
getMultiDimensionArray()  : array<string|int, mixed>
Function to get multi dimension array.
getRaw()  : mixed
Get raw value.
getRequestMethod()  : string
Get request method.
getServer()  : bool
Get server and execution environment information.
has()  : bool
Check for existence of key.
init()  : Request
Static instance initialization.
isAjax()  : bool
Function to check if the ajax request.
isEmpty()  : bool
Function to check if the key is empty.
isJSON()  : bool
Is json.
set()  : $this
Function to set the value for a given key.
validateReadAccess()  : mixed
Validating read access request.
validateWriteAccess()  : mixed
Validating write access request.
purifyMultiDimensionArray()  : mixed
Purify multi dimension array.

Properties

$headersPurifierMap

List of headings and sanitization methods.

public array<string|int, mixed> $headersPurifierMap = []

$headers

Headers request.

protected array<string|int, mixed> $headers

$purifiedValuesByArray

Purified request values for array.

protected array<string|int, mixed> $purifiedValuesByArray = []

$purifiedValuesByDateRange

Purified request values for date range.

protected array<string|int, mixed> $purifiedValuesByDateRange = []

$purifiedValuesByExploded

Purified request values for exploded.

protected array<string|int, mixed> $purifiedValuesByExploded = []

$purifiedValuesByGet

Purified request values for get.

protected array<string|int, mixed> $purifiedValuesByGet = []

$purifiedValuesByHtml

Purified request values for date html.

protected array<string|int, mixed> $purifiedValuesByHtml = []

$purifiedValuesByInteger

Purified request values for integer.

protected array<string|int, mixed> $purifiedValuesByInteger = []

$purifiedValuesByMultiDimension

Purified request values for multi dimension array.

protected array<string|int, mixed> $purifiedValuesByMultiDimension = []

$purifiedValuesByType

Purified request values for type.

protected array<string|int, mixed> $purifiedValuesByType = []

$rawValues

Raw request data.

protected array<string|int, mixed> $rawValues = []

Methods

__callStatic()

Support static methods, all functions must start with "_".

public static __callStatic(string $name[, array<string|int, mixed>|null $arguments = null ]) : mixed
Parameters
$name : string
$arguments : array<string|int, mixed>|null = null
Tags
throws
AppException
Return values
mixed

__construct()

Constructor.

public __construct(array<string|int, mixed> $rawValues[, bool $overwrite = true ]) : mixed
Parameters
$rawValues : array<string|int, mixed>
$overwrite : bool = true
Return values
mixed

delete()

Function to remove the value for a given key.

public delete(string $key) : mixed
Parameters
$key : string
Return values
mixed

get()

Function to get the value for a given key.

public get(string $key[, mixed $value = '' ]) : mixed
Parameters
$key : string
$value : mixed = ''

Default value

Return values
mixed

getAll()

Get all data.

public getAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

getAllRaw()

Get all raw data.

public getAllRaw() : array<string|int, mixed>
Return values
array<string|int, mixed>

getArray()

Function to get the array values for a given key.

public getArray(string $key[, mixed $type = false ][, array<string|int, mixed> $value = [] ][, string|null $keyType = null ]) : array<string|int, mixed>
Parameters
$key : string
$type : mixed = false
$value : array<string|int, mixed> = []
$keyType : string|null = null
Return values
array<string|int, mixed>

getBoolean()

Function to get the boolean value for a given key.

public getBoolean(string $key[, bool $defaultValue = null ]) : bool
Parameters
$key : string
$defaultValue : bool = null

Default value

Return values
bool

getByType()

Purify by data type.

public getByType(string $key[, int|string $type = 'Standard' ][, mixed $convert = false ]) : bool|mixed

Type list: Standard - only words 1 - only words Alnum - word and int 2 - word and int

Parameters
$key : string

Key name

$type : int|string = 'Standard'

Data type that is only acceptable, default only words 'Standard'

$convert : mixed = false
Return values
bool|mixed

getDateRange()

Function to get the date range values for a given key.

public getDateRange(string $key) : array<string|int, mixed>
Parameters
$key : string

request param like 'createdtime'

Return values
array<string|int, mixed>

getExploded()

Function to get the exploded values for a given key.

public getExploded(string $key[, string $delimiter = ',' ][, bool|string $type = false ]) : array<string|int, mixed>
Parameters
$key : string
$delimiter : string = ','
$type : bool|string = false
Return values
array<string|int, mixed>

getForHtml()

Function to get html the value for a given key.

public getForHtml(string $key[, mixed $value = '' ]) : mixed
Parameters
$key : string
$value : mixed = ''
Return values
mixed

getForSql()

Function to get the value if its safe to use for SQL Query (column).

public getForSql(string $key[, bool $skipEmtpy = true ]) : string
Parameters
$key : string
$skipEmtpy : bool = true
Return values
string

getHeader()

Get header for a given key.

public getHeader(string $key) : string
Parameters
$key : string
Return values
string

getHeaders()

Get all headers.

public getHeaders() : array<string|int, string>
Return values
array<string|int, string>

getInteger()

Function to get the integer value for a given key.

public getInteger(string $key, int $value) : int
Parameters
$key : string
$value : int
Return values
int

getKeys()

Get all request keys.

public getKeys() : array<string|int, mixed>
Return values
array<string|int, mixed>

getMode()

Function to get the request mode.

public getMode() : string
Return values
string

getModule()

Get module name.

public getModule([bool $raw = true ]) : string
Parameters
$raw : bool = true
Return values
string

getMultiDimensionArray()

Function to get multi dimension array.

public getMultiDimensionArray(string $key, array<string|int, mixed> $template) : array<string|int, mixed>
Parameters
$key : string
$template : array<string|int, mixed>
Return values
array<string|int, mixed>

getRaw()

Get raw value.

public getRaw(string $key[, mixed $defaultValue = '' ]) : mixed
Parameters
$key : string
$defaultValue : mixed = ''
Return values
mixed

getRequestMethod()

Get request method.

public static getRequestMethod() : string
Tags
throws
AppException
Return values
string

getServer()

Get server and execution environment information.

public getServer(string $key[, mixed $default = false ]) : bool
Parameters
$key : string
$default : mixed = false
Return values
bool

has()

Check for existence of key.

public has(string $key) : bool
Parameters
$key : string
Return values
bool

init()

Static instance initialization.

public static init([array<string|int, mixed>|bool $request = false ]) : Request
Parameters
$request : array<string|int, mixed>|bool = false
Return values
Request

isAjax()

Function to check if the ajax request.

public isAjax() : bool
Return values
bool

isEmpty()

Function to check if the key is empty.

public isEmpty(string $key[, bool $emptyFunction = false ]) : bool
Parameters
$key : string
$emptyFunction : bool = false
Return values
bool

isJSON()

Is json.

public isJSON() : bool
Return values
bool

set()

Function to set the value for a given key.

public set(string $key, mixed $value[, bool $onlyRaw = false ]) : $this
Parameters
$key : string
$value : mixed
$onlyRaw : bool = false
Return values
$this

validateReadAccess()

Validating read access request.

public validateReadAccess() : mixed
Tags
throws
Csrf
Return values
mixed

validateWriteAccess()

Validating write access request.

public validateWriteAccess([bool $skipRequestTypeCheck = false ]) : mixed
Parameters
$skipRequestTypeCheck : bool = false
Tags
throws
Csrf
Return values
mixed

purifyMultiDimensionArray()

Purify multi dimension array.

private purifyMultiDimensionArray(mixed $values, array<string|int, mixed>|string $template) : mixed
Parameters
$values : mixed
$template : array<string|int, mixed>|string
Tags
throws
IllegalValue
Return values
mixed

        

Search results