Menu

## Inputs
in package
implements Iterator

Inputs.php : 20

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

Inputs.php : 27

The array to store the input item objects.

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

### Methods

#### __call()

Inputs.php : 39

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()

Inputs.php : 58

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()

Inputs.php : 103

Returns the current InputItem in the list.

`public current() : InputItem`

##### Return values

InputItem —

The current InputItem

#### get()

Inputs.php : 117

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()

Inputs.php : 128

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

#### next()

Inputs.php : 140

Returns the next InputItem in the list.

`public next() : InputItem`

##### Return values

InputItem —

The next InputItem

#### rewind()

Inputs.php : 150

Rewind the Iterator to the first InputItem in the list.

`public rewind() : mixed`

##### Return values

mixed —

#### valid()

Inputs.php : 161

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()

Inputs.php : 80

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