QueryResult implements QueryResultInterface
A lazy result list that is returned by Query::execute()
Tags
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() : mixed
- 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
$dataMapper
protected
DataMapper
$dataMapper
$numberOfResults
protected
int|null
$numberOfResults
$persistenceManager
protected
PersistenceManagerInterface
$persistenceManager
$query
protected
QueryInterface|null
$query
= null
Tags
$queryResult
protected
array<string|int, mixed>|null
$queryResult
Tags
Methods
__construct()
public
__construct(DataMapper $dataMapper, PersistenceManagerInterface $persistenceManager) : mixed
Parameters
- $dataMapper : DataMapper
- $persistenceManager : PersistenceManagerInterface
__sleep()
public
__sleep() : array<string|int, mixed>
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
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
Attributes
- #[ReturnTypeWillChange]
getFirst()
Returns the first object in the result set
public
getFirst() : object
Tags
Return values
objectgetQuery()
Returns a clone of the query object
public
getQuery() : QueryInterface
Tags
Return values
QueryInterfacekey()
public
key() : mixed
Tags
Attributes
- #[ReturnTypeWillChange]
next()
public
next() : void
Tags
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
booloffsetGet()
public
offsetGet(mixed $offset) : mixed
Parameters
- $offset : mixed
Tags
Attributes
- #[ReturnTypeWillChange]
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
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
setQuery()
public
setQuery(QueryInterface $query) : void
Parameters
- $query : QueryInterface
Tags
toArray()
Returns an array with the objects in the result set
public
toArray() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>valid()
public
valid() : bool
Tags
Return values
boolinitialize()
Loads the objects this QueryResult is supposed to hold
protected
initialize() : mixed