QueryResult implements QueryResultInterface
A lazy result list that is returned by Query::execute()
Tags
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<string|int, TValue>|null
- $queryResult : array<int, TValue>|null
Methods
- __construct() : mixed
- __sleep() : array{0: non-empty-string}
- __wakeup() : void
- 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() : TValue|false
- getFirst() : TValue|null
- Returns the first object in the result set
- getQuery() : QueryInterface<string|int, TValue>
- Returns a clone of the query object
- key() : int|null
- 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<int, TValue>
- Returns an array with the objects in the result set
- valid() : bool
- initialize() : void
- Loads the objects this QueryResult is supposed to hold
Properties
$dataMapper
protected
DataMapper
$dataMapper
$numberOfResults
protected
int|null
$numberOfResults
= null
$persistenceManager
protected
PersistenceManagerInterface
$persistenceManager
$query
protected
QueryInterface<string|int, TValue>|null
$query
= null
$queryResult
protected
array<int, TValue>|null
$queryResult
= null
Methods
__construct()
public
__construct(DataMapper $dataMapper, PersistenceManagerInterface $persistenceManager) : mixed
Parameters
- $dataMapper : DataMapper
- $persistenceManager : PersistenceManagerInterface
__sleep()
public
__sleep() : array{0: non-empty-string}
only to be used within Extbase, not part of TYPO3 Core API.
Return values
array{0: non-empty-string}__wakeup()
Ensures that the persistenceManager and dataMapper are back when loading the QueryResult from the cache
public
__wakeup() : void
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
intcurrent()
public
current() : TValue|false
Tags
Return values
TValue|falsegetFirst()
Returns the first object in the result set
public
getFirst() : TValue|null
Return values
TValue|nullgetQuery()
Returns a clone of the query object
public
getQuery() : QueryInterface<string|int, TValue>
Return values
QueryInterface<string|int, TValue>key()
public
key() : int|null
Tags
Return values
int|nullnext()
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(string|int $offset) : bool
Parameters
- $offset : string|int
Return values
booloffsetGet()
public
offsetGet(string|int $offset) : TValue|null
Parameters
- $offset : string|int
Return values
TValue|nulloffsetSet()
This method has no effect on the persisted objects but only on the result set
public
offsetSet(string|int $offset, TValue $value) : void
Parameters
- $offset : string|int
- $value : TValue
offsetUnset()
This method has no effect on the persisted objects but only on the result set
public
offsetUnset(string|int $offset) : void
Parameters
- $offset : string|int
rewind()
public
rewind() : void
Tags
setQuery()
public
setQuery(QueryInterface<string|int, TValue> $query) : void
Parameters
- $query : QueryInterface<string|int, TValue>
toArray()
Returns an array with the objects in the result set
public
toArray() : array<int, TValue>
Return values
array<int, TValue>valid()
public
valid() : bool
Tags
Return values
boolinitialize()
Loads the objects this QueryResult is supposed to hold
protected
initialize() : void