PHP Class Jackalope\Query\QueryResult

The \Traversable interface enables the implementation to be addressed with foreach. QueryResults have to implement einther \RecursiveIterator or \Iterator. The iterator is equivalent to getRows() returning a list of the rows. The iterator keys have no significant meaning. Note: We use getRows and not getNodes as this is more generic. If you have a single selector, you can either do foreach on getNodes or call getNode on the rows.
Inheritance: implements IteratorAggregate, implements PHPCR\Query\QueryResultInterface
Show file Open project: jackalope/jackalope

Protected Properties

Property Type Description
$factory Jackalope\FactoryInterface
$objectmanager Jackalope\ObjectManager
$rows array Storing the query result raw data

Public Methods

Method Description
__construct ( Jackalope\FactoryInterface $factory, array $rawData, ObjectManager $objectManager ) Create a new query result from raw data from transport.
getColumnNames ( ) {@inheritDoc}
getIterator ( ) : Iterator Implement the IteratorAggregate interface and returns exactly the same iterator as QueryResult::getRows()
getNodes ( $prefetch = false ) {@inheritDoc}
getRows ( ) {@inheritDoc}
getSelectorNames ( ) {@inheritDoc}

Method Details

__construct() public method

Create a new query result from raw data from transport.
See also: QueryInterface::query() The raw data format
public __construct ( Jackalope\FactoryInterface $factory, array $rawData, ObjectManager $objectManager )
$factory Jackalope\FactoryInterface the object factory
$rawData array the data as returned by the transport
$objectManager Jackalope\ObjectManager

getColumnNames() public method

{@inheritDoc}
public getColumnNames ( )

getIterator() public method

Implement the IteratorAggregate interface and returns exactly the same iterator as QueryResult::getRows()
public getIterator ( ) : Iterator
return Iterator implementing SeekableIterator and Countable. Keys are the row position in this result set, Values are the RowInterface instances.

getNodes() public method

{@inheritDoc}
public getNodes ( $prefetch = false )

getRows() public method

{@inheritDoc}
public getRows ( )

getSelectorNames() public method

{@inheritDoc}
public getSelectorNames ( )

Property Details

$factory protected property

protected FactoryInterface,Jackalope $factory
return Jackalope\FactoryInterface

$objectmanager protected property

protected ObjectManager,Jackalope $objectmanager
return Jackalope\ObjectManager

$rows protected property

Storing the query result raw data
See also: QueryInterface::query()
protected array $rows
return array