class QueryResult implements QueryResultInterface (View source)

deprecated since Flow 6.0

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

Properties

protected DataMapper $dataMapper
protected PersistenceManagerInterface $persistenceManager
protected QueryInterface $query
protected array $queryResult
protected array $numberOfResults

Methods

__construct(QueryInterface $query)

Constructor

void
injectDataMapper(DataMapper $dataMapper)

Injects the DataMapper to map records to objects

void
injectPersistenceManager(PersistenceManagerInterface $persistenceManager)

Injects the persistence manager

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, if any.

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(QueryInterface $query)

Constructor

Parameters

QueryInterface $query

void injectDataMapper(DataMapper $dataMapper)

Injects the DataMapper to map records to objects

Parameters

DataMapper $dataMapper

Return Value

void

void injectPersistenceManager(PersistenceManagerInterface $persistenceManager)

Injects the persistence manager

Parameters

PersistenceManagerInterface $persistenceManager

Return Value

void

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, if any.

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

See also

\ArrayAccess::offsetExists()

mixed offsetGet(mixed $offset)

No description

Parameters

mixed $offset

Return Value

mixed

See also

\ArrayAccess::offsetGet()

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

See also

\ArrayAccess::offsetSet()

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

See also

\ArrayAccess::offsetUnset()

mixed current()

No description

Return Value

mixed

See also

\Iterator::current()

mixed key()

No description

Return Value

mixed

See also

\Iterator::key()

void next()

No description

Return Value

void

See also

\Iterator::next()

void rewind()

No description

Return Value

void

See also

\Iterator::rewind()

bool valid()

No description

Return Value

bool

See also

\Iterator::valid()