Context
in package
Table of Contents
Properties
- $params : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructor
- addParam() : mixed
- Add a parameter to the context
- getAllParams() : array<string|int, ContextParam>
- Get all context params
- getParam() : ContextParamInterface|null
- Get a parameter by its class name
- getParams() : array<string|int, ContextParamInterface>
- Get all context params by type
- getParamValueOrEmptyString() : string
- Get the value of a parameter by its class name, or an empty string if not set
- toArray() : array<string|int, mixed>
- Get the context as an array
- validate() : mixed
- Validate all parameters in the context
- hasParam() : bool
- Check if a parameter exists
Properties
$params
private
array<string|int, mixed>
$params
= array()
Methods
__construct()
Constructor
public
__construct([mixed $params = array() ]) : mixed
Parameters
- $params : mixed = array()
addParam()
Add a parameter to the context
public
addParam(ContextParamInterface $param) : mixed
Parameters
- $param : ContextParamInterface
Tags
getAllParams()
Get all context params
public
getAllParams() : array<string|int, ContextParam>
Return values
array<string|int, ContextParam>getParam()
Get a parameter by its class name
public
getParam(string $paramClass) : ContextParamInterface|null
Parameters
- $paramClass : string
Return values
ContextParamInterface|nullgetParams()
Get all context params by type
public
getParams(string $type) : array<string|int, ContextParamInterface>
Parameters
- $type : string
Return values
array<string|int, ContextParamInterface>getParamValueOrEmptyString()
Get the value of a parameter by its class name, or an empty string if not set
public
getParamValueOrEmptyString(string $paramClass) : string
Parameters
- $paramClass : string
Return values
stringtoArray()
Get the context as an array
public
toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>validate()
Validate all parameters in the context
public
validate() : mixed
Tags
hasParam()
Check if a parameter exists
private
hasParam(string $paramClass) : bool
Parameters
- $paramClass : string