final class Rows implements Iterator, ArrayAccess (View source)

Rows represent a result of statement execution.

Methods

__construct()

No description

int
count()

Returns the number of rows.

void
rewind()

Resets the rows iterator.

mixed
current()

Returns current row.

mixed
key()

Returns current index.

void
next()

Advances the rows iterator by one.

bool
valid()

Returns existence of more rows being available.

bool
offsetExists(TKey $offset)

Returns existence of a given row.

mixed
offsetGet(TKey $offset)

Returns a row at given index.

void
offsetSet(TKey $offset, TValue $value)

Sets a row at given index.

void
offsetUnset(TKey $offset)

Removes a row at given index.

bool
isLastPage()

Check for the last page when paging.

Rows|null
nextPage(float|null $timeout)

Get the next page of results.

nextPageAsync()

Get the next page of results asynchronously.

string
pagingStateToken()

Returns the raw paging state token.

array|null
first()

Get the first row.

Details

__construct()

No description

int count()

Returns the number of rows.

Return Value

int

number of rows

See also

Countable::count

void rewind()

Resets the rows iterator.

Return Value

void

Any returned value is ignored.

See also

Iterator::rewind

mixed current()

Returns current row.

Return Value

mixed

Can return any type.

See also

Iterator::current

mixed key()

Returns current index.

Return Value

mixed

TKey on success, or null on failure.

See also

Iterator::key

void next()

Advances the rows iterator by one.

Return Value

void

Any returned value is ignored.

See also

Iterator::next

bool valid()

Returns existence of more rows being available.

Return Value

bool

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

See also

Iterator::valid

bool offsetExists(TKey $offset)

Returns existence of a given row.

Parameters

TKey $offset

An offset to check for.

Return Value

bool

true on success or false on failure.

The return value will be casted to boolean if non-boolean was returned.

See also

ArrayAccess::offsetExists

mixed offsetGet(TKey $offset)

Returns a row at given index.

Parameters

TKey $offset

The offset to retrieve.

Return Value

mixed

Can return all value types.

See also

ArrayAccess::offsetGet

void offsetSet(TKey $offset, TValue $value)

Sets a row at given index.

Parameters

TKey $offset

The offset to assign the value to.

TValue $value

The value to set.

Return Value

void

Exceptions

DomainException

See also

ArrayAccess::offsetSet

void offsetUnset(TKey $offset)

Removes a row at given index.

Parameters

TKey $offset

The offset to unset.

Return Value

void

Exceptions

DomainException

See also

ArrayAccess::offsetUnset

bool isLastPage()

Check for the last page when paging.

Return Value

bool

whether this is the last page or not

Rows|null nextPage(float|null $timeout)

Get the next page of results.

Parameters

float|null $timeout

Return Value

Rows|null

loads and returns next result page

Future nextPageAsync()

Get the next page of results asynchronously.

Return Value

Future

returns future of the next result page

string pagingStateToken()

Returns the raw paging state token.

Return Value

string

array|null first()

Get the first row.

Return Value

array|null

returns first row if any