class QueryResult implements QueryResultInterface (View source)

A lazy result list that is returned by Query::execute()

Properties

protected array $rows
protected int $numberOfRows
protected Query $query

Methods

__construct(Query $query)

No description

void
initialize()

Loads the objects this QueryResult is supposed to hold

getQuery()

Returns a clone of the query object

object|null
getFirst()

Returns the first object in the result set

int
count()

Returns the number of objects in the result

array
toArray()

Returns an array with the objects in the result set

bool
offsetExists(mixed $offset)

This method is needed to implement the \ArrayAccess interface, but it isn't very useful as the offset has to be an integer

mixed
offsetGet(mixed $offset)

No description

void
offsetSet(mixed $offset, mixed $value)

This method has no effect on the persisted objects but only on the result set

void
offsetUnset(mixed $offset)

This method has no effect on the persisted objects but only on the result set

mixed
current()

No description

mixed
key()

No description

void
next()

No description

void
rewind()

No description

bool
valid()

No description

Details

__construct(Query $query)

No description

Parameters

Query $query

protected void initialize()

Loads the objects this QueryResult is supposed to hold

Return Value

void

QueryInterface getQuery()

Returns a clone of the query object

Return Value

QueryInterface

object|null getFirst()

Returns the first object in the result set

Return Value

object|null

int count()

Returns the number of objects in the result

Return Value

int

The number of matching objects

array toArray()

Returns an array with the objects in the result set

Return Value

array

bool offsetExists(mixed $offset)

This method is needed to implement the \ArrayAccess interface, but it isn't very useful as the offset has to be an integer

Parameters

mixed $offset

Return Value

bool

mixed offsetGet(mixed $offset)

No description

Parameters

mixed $offset

Return Value

mixed

void offsetSet(mixed $offset, mixed $value)

This method has no effect on the persisted objects but only on the result set

Parameters

mixed $offset
mixed $value

Return Value

void

void offsetUnset(mixed $offset)

This method has no effect on the persisted objects but only on the result set

Parameters

mixed $offset

Return Value

void

mixed current()

No description

Return Value

mixed

mixed key()

No description

Return Value

mixed

void next()

No description

Return Value

void

void rewind()

No description

Return Value

void

bool valid()

No description

Return Value

bool