PHP Class JamesMoss\Flywheel\QueryExecuter

Builds an executes a query whichs searches and sorts documents from a repository.
Afficher le fichier Open project: jamesmoss/flywheel Class Usage Examples

Protected Properties

Свойство Type Description
$limit
$orderBy
$predicate
$repo

Méthodes publiques

Méthode Description
__construct ( Repository $repo, Predicate $pred, array $limit, array $orderBy ) Constructor
getFieldValue ( $doc, $field, &$found = false )
matchDocument ( $doc, $field, $operator, $value )
run ( ) : Result Runs the query.

Méthodes protégées

Méthode Description
filter ( $documents, $predicates )
sort ( array $array, array $args ) : array Sorts an array of documents by multiple fields if needed.

Method Details

__construct() public méthode

Constructor
public __construct ( Repository $repo, Predicate $pred, array $limit, array $orderBy )
$repo Repository The repo to execute against
$pred Predicate The predicate to use.
$limit array The count and offset.
$orderBy array An array of field names to order by

filter() protected méthode

protected filter ( $documents, $predicates )

getFieldValue() public méthode

public getFieldValue ( $doc, $field, &$found = false )

matchDocument() public méthode

public matchDocument ( $doc, $field, $operator, $value )

run() public méthode

Runs the query.
public run ( ) : Result
Résultat Result The documents returned from this query.

sort() protected méthode

Sorts an array of documents by multiple fields if needed.
protected sort ( array $array, array $args ) : array
$array array An array of Documents.
$args array The fields to sort by.
Résultat array The sorted array of documents.

Property Details

$limit protected_oe property

protected $limit

$orderBy protected_oe property

protected $orderBy

$predicate protected_oe property

protected $predicate

$repo protected_oe property

protected $repo