Kotchasan

Inputs
in package
implements Iterator

Input item array wrapper class.

This class represents an array of input items.

Tags
see
https://www.kotchasan.com/

Interfaces, Classes and Traits

Iterator

Table of Contents

$datas  : array<string|int, mixed>
The array to store the input item objects.
__call()  : array<string|int, mixed>
Magic method to retrieve data for array type input.
__construct()  : mixed
Class constructor.
current()  : InputItem
Returns the current InputItem in the list.
get()  : InputItem
Get the specified InputItem.
key()  : string
Returns the key or index of the current InputItem in the list.
next()  : InputItem
Returns the next InputItem in the list.
rewind()  : mixed
Rewind the Iterator to the first InputItem in the list.
valid()  : bool
Checks if the current position of the Iterator is valid.
collectInputs()  : array<string|int, mixed>|object
Prepare the result for array type input.

Properties

$datas

The array to store the input item objects.

private array<string|int, mixed> $datas = []

Methods

__call()

Magic method to retrieve data for array type input.

public __call(string $name, array<string|int, mixed> $arguments) : array<string|int, mixed>
Parameters
$name : string
$arguments : array<string|int, mixed>
Tags
throws
InvalidArgumentException

If the requested method does not exist

Return values
array<string|int, mixed>

The array of input item values

__construct()

Class constructor.

public __construct([array<string|int, mixed> $items = [] ][, string|null $type = null ]) : mixed
Parameters
$items : array<string|int, mixed> = []

The input items array

$type : string|null = null

The input type (e.g., GET, POST, SESSION, COOKIE) or null if not derived from the above lists

Return values
mixed

current()

Returns the current InputItem in the list.

public current() : InputItem
Return values
InputItem

The current InputItem

get()

Get the specified InputItem.

public get(string|int $key) : InputItem
Parameters
$key : string|int

The key of the input item to retrieve

Return values
InputItem

The specified InputItem

key()

Returns the key or index of the current InputItem in the list.

public key() : string
Return values
string

The key or index of the current InputItem

rewind()

Rewind the Iterator to the first InputItem in the list.

public rewind() : mixed
Return values
mixed

valid()

Checks if the current position of the Iterator is valid.

public valid() : bool
Return values
bool

True if the current position is valid, false otherwise

collectInputs()

Prepare the result for array type input.

private collectInputs(object $item, string $name, array<string|int, mixed> $arguments) : array<string|int, mixed>|object
Parameters
$item : object

The input item object

$name : string

The method name to call

$arguments : array<string|int, mixed>

The method arguments

Return values
array<string|int, mixed>|object

The array of input item values or an object

Search results