QueryResult implements QueryResultInterface

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

Tags
todo

v12: Candidate to declare final - Can be decorated or standalone class implementing the interface

template

TValue of object

implements

QueryResultInterface<mixed,TValue>

Attributes
#[Autoconfigure]
$public: true
$shared: false

Table of Contents

Interfaces

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

Properties

$dataMapper  : DataMapper
$numberOfResults  : int|null
$persistenceManager  : PersistenceManagerInterface
$query  : QueryInterface|null
$queryResult  : array<string|int, mixed>|null

Methods

__construct()  : mixed
__sleep()  : array<string|int, mixed>
__wakeup()  : mixed
Ensures that the persistenceManager and dataMapper are back when loading the QueryResult from the cache
count()  : int
Returns the number of objects in the result
current()  : mixed
getFirst()  : object
Returns the first object in the result set
getQuery()  : QueryInterface
Returns a clone of the query object
key()  : mixed
next()  : void
offsetExists()  : bool
This method is needed to implement the ArrayAccess interface, but it isn't very useful as the offset has to be an integer
offsetGet()  : TValue|null
offsetSet()  : void
This method has no effect on the persisted objects but only on the result set
offsetUnset()  : void
This method has no effect on the persisted objects but only on the result set
rewind()  : void
setQuery()  : void
toArray()  : array<string|int, mixed>
Returns an array with the objects in the result set
valid()  : bool
initialize()  : mixed
Loads the objects this QueryResult is supposed to hold

Properties

$numberOfResults

protected int|null $numberOfResults

$queryResult

protected array<string|int, mixed>|null $queryResult
Tags
phpstan-var

list<TValue>|null

Methods

__sleep()

public __sleep() : array<string|int, mixed>
Internal

only to be used within Extbase, not part of TYPO3 Core API.

Return values
array<string|int, mixed>

__wakeup()

Ensures that the persistenceManager and dataMapper are back when loading the QueryResult from the cache

public __wakeup() : mixed
Internal

only to be used within Extbase, not part of TYPO3 Core API.

count()

Returns the number of objects in the result

public count() : int
Return values
int

The number of matching objects

current()

public current() : mixed
Tags
see
Iterator::current()

getFirst()

Returns the first object in the result set

public getFirst() : object
Tags
phpstan-return

TValue|null

Return values
object

key()

public key() : mixed
Tags
see
Iterator::key()

next()

public next() : void
Tags
see
Iterator::next()

offsetExists()

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

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

public offsetGet(mixed $offset) : TValue|null
Parameters
$offset : mixed
Return values
TValue|null

offsetSet()

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

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed
Tags
phpstan-param

TValue $value

offsetUnset()

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

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

rewind()

public rewind() : void
Tags
see
Iterator::rewind()

toArray()

Returns an array with the objects in the result set

public toArray() : array<string|int, mixed>
Tags
phpstan-return

list<TValue>

Return values
array<string|int, mixed>

valid()

public valid() : bool
Tags
see
Iterator::valid()
Return values
bool

initialize()

Loads the objects this QueryResult is supposed to hold

protected initialize() : mixed

        
On this page

Search results