PHP 클래스 JamesMoss\Flywheel\Query

Builds an executes a query whichs searches and sorts documents from a repository.
파일 보기 프로젝트 열기: jamesmoss/flywheel 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$limit
$orderBy
$predicate
$repo

공개 메소드들

메소드 설명
__construct ( Repository $repository ) Constructor
andWhere ( string | Closure $field, string $operator = null, string $value = null ) : Query Adds a boolean AND predicate for this query,
execute ( ) : Result Runs the query.
limit ( integer $count, integer $offset ) : Query Set a limit on the number of documents returned. An offset from 0 can also be specified.
orWhere ( string | Closure $field, string $operator = null, string $value = null ) : Query Adds a boolean OR predicate for this query,
orderBy ( mixed $fields ) : Query Sets the fields to order the results by. They should be in the the format 'fieldname ASC|DESC'. e.g 'dateAdded DESC'.
where ( $field, $operator = null, $value = null ) : Query

메소드 상세

__construct() 공개 메소드

Constructor
public __construct ( Repository $repository )
$repository Repository The repo this query will run against.

andWhere() 공개 메소드

Adds a boolean AND predicate for this query,
public andWhere ( string | Closure $field, string $operator = null, string $value = null ) : Query
$field string | Closure The name of the field to match or an anonymous function that will define sub predicates.
$operator string An operator from the allowed list.
$value string The value to compare against.
리턴 Query The same instance of this class.

execute() 공개 메소드

Runs the query.
public execute ( ) : Result
리턴 Result The documents returned from this query.

limit() 공개 메소드

Set a limit on the number of documents returned. An offset from 0 can also be specified.
public limit ( integer $count, integer $offset ) : Query
$count integer The number of documents to return.
$offset integer The offset from which to return.
리턴 Query The same instance of this class.

orWhere() 공개 메소드

Adds a boolean OR predicate for this query,
public orWhere ( string | Closure $field, string $operator = null, string $value = null ) : Query
$field string | Closure The name of the field to match or an anonymous function that will define sub predicates.
$operator string An operator from the allowed list.
$value string The value to compare against.
리턴 Query The same instance of this class.

orderBy() 공개 메소드

Sets the fields to order the results by. They should be in the the format 'fieldname ASC|DESC'. e.g 'dateAdded DESC'.
public orderBy ( mixed $fields ) : Query
$fields mixed An array comprising strings in the above format (or a single string)
리턴 Query The same instance of this class.

where() 공개 메소드

또한 보기: Query::andWhere
public where ( $field, $operator = null, $value = null ) : Query
리턴 Query The same instance of this class.

프로퍼티 상세

$limit 보호되어 있는 프로퍼티

protected $limit

$orderBy 보호되어 있는 프로퍼티

protected $orderBy

$predicate 보호되어 있는 프로퍼티

protected $predicate

$repo 보호되어 있는 프로퍼티

protected $repo