QueryResult implements QueryResultInterface, ForwardCompatibleQueryResultInterface

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

Tags
todo

v12: Drop ForwardCompatibleQueryResultInterface when merged into QueryResultInterface

todo

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

Table of Contents

Interfaces

QueryResultInterface
A lazy result list that is returned by Query::execute()
ForwardCompatibleQueryResultInterface
Helper interface for v11 DI to see if a QueryResult can be autowired, or if a fallback to ObjectManager needs to be done.

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()  : mixed
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()  : mixed
offsetSet()  : mixed
This method has no effect on the persisted objects but only on the result set
offsetUnset()  : mixed
This method has no effect on the persisted objects but only on the result set
rewind()  : mixed
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

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
Tags
todo

Set to return type int as breaking patch in v12.

Attributes
#[ReturnTypeWillChange]
Return values
int

The number of matching objects

current()

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

Set return type to mixed as breaking patch in v12.

Attributes
#[ReturnTypeWillChange]

getFirst()

Returns the first object in the result set

public getFirst() : object
Return values
object

key()

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

Set return type to mixed as breaking patch in v12.

Attributes
#[ReturnTypeWillChange]

next()

public next() : mixed
Tags
see
Iterator::next()
todo

Set return type to void as breaking patch in v12.

Attributes
#[ReturnTypeWillChange]

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
Tags
see
ArrayAccess::offsetExists()
todo

Set $offset to mixed type as breaking change in v12.

todo

Set to return type bool as breaking change in v12.

Attributes
#[ReturnTypeWillChange]
Return values
bool

offsetGet()

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed
Tags
see
ArrayAccess::offsetGet()
todo

Set $offset to mixed type as breaking change in v12.

todo

Set return type to ?mixed as breaking patch in v12.

Attributes
#[ReturnTypeWillChange]

offsetSet()

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

public offsetSet(mixed $offset, mixed $value) : mixed
Parameters
$offset : mixed
$value : mixed
Tags
see
ArrayAccess::offsetSet()
todo

Set $offset and $value to mixed type as breaking change in v12.

todo

Set return type to void as breaking patch in v12.

Attributes
#[ReturnTypeWillChange]

offsetUnset()

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

public offsetUnset(mixed $offset) : mixed
Parameters
$offset : mixed
Tags
see
ArrayAccess::offsetUnset()
todo

Set $offset to mixed type as breaking change in v12.

todo

Set return type to void as breaking patch in v12.

Attributes
#[ReturnTypeWillChange]

rewind()

public rewind() : mixed
Tags
see
Iterator::rewind()
todo

Set return type to void as breaking patch in v12.

Attributes
#[ReturnTypeWillChange]

toArray()

Returns an array with the objects in the result set

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

valid()

public valid() : bool
Tags
see
Iterator::valid()
todo

Set return type to bool as breaking patch in v12.

Attributes
#[ReturnTypeWillChange]
Return values
bool

initialize()

Loads the objects this QueryResult is supposed to hold

protected initialize() : mixed

        
On this page

Search results