Parameters
extends ArrayObject
in package
implements
ParametersInterface
Tags
Table of Contents
Interfaces
- ParametersInterface
- Basically, an ArrayObject. You could simply define something like: class QueryParams extends ArrayObject implements Parameters {} and have 90% of the functionality
Methods
- __construct() : mixed
- Constructor
- fromArray() : void
- Populate from native PHP array
- fromString() : void
- Populate from query string
- get() : TValue|TDefault|null
- offsetGet() : TValue|null
- Retrieve by key
- set() : $this
- toArray() : mixed
- Serialize to native PHP array
- toString() : string
- Serialize to query string
Methods
__construct()
Constructor
public
__construct([array<string|int, mixed>|null $values = null ]) : mixed
Enforces that we have an array, and enforces parameter access to array elements.
Parameters
- $values : array<string|int, mixed>|null = null
fromArray()
Populate from native PHP array
public
fromArray(array<string|int, mixed> $values) : void
Parameters
- $values : array<string|int, mixed>
fromString()
Populate from query string
public
fromString(string $string) : void
Parameters
- $string : string
get()
public
get(TKey $name[, TDefault $default = null ]) : TValue|TDefault|null
Parameters
- $name : TKey
- $default : TDefault = null
-
optional default value
Tags
Return values
TValue|TDefault|nulloffsetGet()
Retrieve by key
public
offsetGet(TKey $name) : TValue|null
Returns null if the key does not exist.
Parameters
- $name : TKey
Attributes
Return values
TValue|nullset()
public
set(TKey $name, TValue $value) : $this
Parameters
- $name : TKey
- $value : TValue
Return values
$thistoArray()
Serialize to native PHP array
public
toArray() : mixed
toString()
Serialize to query string
public
toString() : string