PHP Class Bravo3\Orm\Query\QueryResult

Inheritance: implements Countable, implements Iterator, implements ArrayAccess
Afficher le fichier Open project: bravo3/orm

Protected Properties

Свойство Type Description
$entities array
$entity_manager Bravo3\Orm\Services\EntityManager
$full_size integer
$id_list string[]
$iterator ArrayIterator
$query Bravo3\Orm\Query\QueryInterface
$use_cache boolean

Méthodes publiques

Méthode Description
__construct ( EntityManager $entity_manager, Bravo3\Orm\Query\QueryInterface $query, array $results, $full_size = null, $use_cache = true )
count ( ) : integer Result set size
current ( ) : object Return the current entity
getEntityById ( string $id ) : object | null Return an entity from the results by its ID
getFullSize ( ) : integer Get the full size of the query, without any limits applied to it
getIdList ( ) : string[] Get the full list of IDs returned in the query
getQuery ( ) : Bravo3\Orm\Query\QueryInterface Get the search query
key ( ) : mixed Get the key of the current element
next ( ) Move forward to the next entity
offsetExists ( integer $offset ) : boolean Check if an ID is in the result set
offsetGet ( integer $offset ) : object Retrieve the entity at position $offset
offsetSet ( integer $offset, mixed $value ) You cannot set query elements, calling this function will throw a \LogicException
offsetUnset ( integer $offset ) You cannot unset query elements, calling this function will throw a \LogicException
rewind ( ) Rewind the Iterator to the first element
valid ( ) : boolean Checks if current position is valid

Private Methods

Méthode Description
hydrateEntity ( string $id ) Hydrate an entity

Method Details

__construct() public méthode

public __construct ( EntityManager $entity_manager, Bravo3\Orm\Query\QueryInterface $query, array $results, $full_size = null, $use_cache = true )
$entity_manager Bravo3\Orm\Services\EntityManager
$query Bravo3\Orm\Query\QueryInterface
$results array

count() public méthode

Result set size
public count ( ) : integer
Résultat integer

current() public méthode

Return the current entity
public current ( ) : object
Résultat object

getEntityById() public méthode

Return an entity from the results by its ID
public getEntityById ( string $id ) : object | null
$id string
Résultat object | null

getFullSize() public méthode

This information may not be available, and should be explicitly requested when creating the query.
public getFullSize ( ) : integer
Résultat integer

getIdList() public méthode

Get the full list of IDs returned in the query
public getIdList ( ) : string[]
Résultat string[]

getQuery() public méthode

Get the search query
public getQuery ( ) : Bravo3\Orm\Query\QueryInterface
Résultat Bravo3\Orm\Query\QueryInterface

key() public méthode

Get the key of the current element
public key ( ) : mixed
Résultat mixed scalar on success, or null on failure.

next() public méthode

Move forward to the next entity
public next ( )

offsetExists() public méthode

Check if an ID is in the result set
public offsetExists ( integer $offset ) : boolean
$offset integer
Résultat boolean

offsetGet() public méthode

Retrieve the entity at position $offset
public offsetGet ( integer $offset ) : object
$offset integer
Résultat object

offsetSet() public méthode

You cannot set query elements, calling this function will throw a \LogicException
public offsetSet ( integer $offset, mixed $value )
$offset integer
$value mixed

offsetUnset() public méthode

You cannot unset query elements, calling this function will throw a \LogicException
public offsetUnset ( integer $offset )
$offset integer

rewind() public méthode

Rewind the Iterator to the first element
public rewind ( )

valid() public méthode

Checks if current position is valid
public valid ( ) : boolean
Résultat boolean Returns true on success or false on failure.

Property Details

$entities protected_oe property

protected array $entities
Résultat array

$entity_manager protected_oe property

protected EntityManager,Bravo3\Orm\Services $entity_manager
Résultat Bravo3\Orm\Services\EntityManager

$full_size protected_oe property

protected int $full_size
Résultat integer

$id_list protected_oe property

protected string[] $id_list
Résultat string[]

$iterator protected_oe property

protected ArrayIterator $iterator
Résultat ArrayIterator

$query protected_oe property

protected QueryInterface,Bravo3\Orm\Query $query
Résultat Bravo3\Orm\Query\QueryInterface

$use_cache protected_oe property

protected bool $use_cache
Résultat boolean