final class Tuple implements Value, Countable, Iterator (View source)

A PHP representation of the CQL tuple datatype

Methods

__construct(array $types)

Creates a new tuple with the given types.

type()

The type of this tuple.

array
values()

Array of values in this tuple.

void
set(mixed $value)

Sets the value at index in this tuple .

mixed
get(int $index)

Retrieves the value at a given index.

int
count()

Total number of elements in this tuple

mixed
current()

Current element for iteration

mixed
key()

Current key for iteration

void
next()

Move internal iterator forward

bool
valid()

Check whether a current value exists

void
rewind()

Rewind internal iterator

Details

__construct(array $types)

Creates a new tuple with the given types.

Parameters

array $types

Array of types

Type type()

The type of this tuple.

Return Value

Type

array values()

Array of values in this tuple.

Return Value

array values

void set(mixed $value)

Sets the value at index in this tuple .

Parameters

mixed $value

A value or null

Return Value

void

mixed get(int $index)

Retrieves the value at a given index.

Parameters

int $index Index

Return Value

mixed

A value or null

int count()

Total number of elements in this tuple

Return Value

int

The custom count as an integer.

The return value is cast to an integer.

mixed current()

Current element for iteration

Return Value

mixed

Can return any type.

mixed key()

Current key for iteration

Return Value

mixed

TKey on success, or null on failure.

void next()

Move internal iterator forward

Return Value

void

Any returned value is ignored.

bool valid()

Check whether a current value exists

Return Value

bool

The return value will be casted to boolean and then evaluated. Returns true on success or false on failure.

void rewind()

Rewind internal iterator

Return Value

void

Any returned value is ignored.