HumHub Documentation (unofficial)

Parameters extends ArrayObject
in package
implements ParametersInterface

Tags
template

TKey of array-key

template

TValue

template-extends

PhpArrayObject<TKey, TValue>

template-implements

ParametersInterface<TKey, TValue>

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
template

TDefault

Return values
TValue|TDefault|null

offsetGet()

Retrieve by key

public offsetGet(TKey $name) : TValue|null

Returns null if the key does not exist.

Parameters
$name : TKey
Attributes
#[ReturnTypeWillChange]
Return values
TValue|null

set()

public set(TKey $name, TValue $value) : $this
Parameters
$name : TKey
$value : TValue
Return values
$this

toArray()

Serialize to native PHP array

public toArray() : mixed

toString()

Serialize to query string

public toString() : string
Return values
string

        
On this page

Search results