PHP 클래스 Doctrine\MongoDB\Query\Query

부터: 1.0
저자: Jonathan H. Wage ([email protected])
저자: Bulat Shakirzyanov ([email protected])
상속: implements Doctrine\MongoDB\IteratorAggregate
파일 보기 프로젝트 열기: doctrine/mongodb 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$collection Doctrine\MongoDB\Collection The Collection instance.
$iterator Doctrine\MongoDB\Iterator
$options array Query options
$query array Query structure generated by the Builder class.

공개 메소드들

메소드 설명
__construct ( Doctrine\MongoDB\Collection $collection, array $query, array $options ) Constructor.
count ( boolean $foundOnly = false ) : integer Count the number of results for this query.
debug ( string $name = null ) : mixed Return an array of information about the query structure for debugging.
execute ( ) : mixed Execute the query and return its result.
getIterator ( ) : Doctrine\MongoDB\Iterator Execute the query and return its result, which must be an Iterator.
getQuery ( ) : array Return the query structure.
getSingleResult ( ) : array | object | null Execute the query and return the first result.
getType ( ) : integer Return the query type.
iterate ( ) : Doctrine\MongoDB\Iterator Alias of {@link Query::getIterator()}.
toArray ( ) : array Execute the query and return its results as an array.

보호된 메소드들

메소드 설명
prepareCursor ( Doctrine\MongoDB\Cursor $cursor ) : Doctrine\MongoDB\CursorInterface Prepare the Cursor returned by {@link Query::execute()}.

비공개 메소드들

메소드 설명
getQueryOptions ( ) : array Returns an array containing the specified keys and their values from the query array, provided they exist and are not null.
renameQueryOptions ( array $options, array $rename ) : array Returns an array with its keys renamed based on the translation map.
withReadPreference ( Doctrine\MongoDB\Database | Doctrine\MongoDB\Collection $object, Closure $closure ) : mixed Executes a closure with a temporary read preference on a database or collection.

메소드 상세

__construct() 공개 메소드

Constructor.
public __construct ( Doctrine\MongoDB\Collection $collection, array $query, array $options )
$collection Doctrine\MongoDB\Collection
$query array
$options array

count() 공개 메소드

If the query resulted in a Cursor, the $foundOnly parameter will ignore limit/skip values if false (the default). If the Query resulted in an EagerCursor or ArrayIterator, the $foundOnly parameter has no effect.
public count ( boolean $foundOnly = false ) : integer
$foundOnly boolean
리턴 integer

debug() 공개 메소드

The $name parameter may be used to return a specific key from the internal $query array property. If omitted, the entire array will be returned.
public debug ( string $name = null ) : mixed
$name string
리턴 mixed

execute() 공개 메소드

The return value will vary based on the query type. Commands with results (e.g. aggregate, inline mapReduce) may return an ArrayIterator. Other commands and operations may return a status array or a boolean, depending on the driver's write concern. Queries and some mapReduce commands will return a CursorInterface.
public execute ( ) : mixed
리턴 mixed

getIterator() 공개 메소드

If the query type is not expected to return an Iterator, BadMethodCallException will be thrown before executing the query. Otherwise, the query will be executed and UnexpectedValueException will be thrown if {@link Query::execute()} does not return an Iterator.
또한 보기: http://php.net/manual/en/iteratoraggregate.getiterator.php
public getIterator ( ) : Doctrine\MongoDB\Iterator
리턴 Doctrine\MongoDB\Iterator

getQuery() 공개 메소드

Return the query structure.
public getQuery ( ) : array
리턴 array

getSingleResult() 공개 메소드

Execute the query and return the first result.
또한 보기: IteratorAggregate::getSingleResult()
public getSingleResult ( ) : array | object | null
리턴 array | object | null

getType() 공개 메소드

Return the query type.
public getType ( ) : integer
리턴 integer

iterate() 공개 메소드

Alias of {@link Query::getIterator()}.
사용 중단: 1.1 Use {@link Query::getIterator()}; will be removed for 2.0
public iterate ( ) : Doctrine\MongoDB\Iterator
리턴 Doctrine\MongoDB\Iterator

prepareCursor() 보호된 메소드

This method will apply cursor options present in the query structure array. The Cursor may also be wrapped with an EagerCursor.
protected prepareCursor ( Doctrine\MongoDB\Cursor $cursor ) : Doctrine\MongoDB\CursorInterface
$cursor Doctrine\MongoDB\Cursor
리턴 Doctrine\MongoDB\CursorInterface

toArray() 공개 메소드

Execute the query and return its results as an array.
또한 보기: IteratorAggregate::toArray()
public toArray ( ) : array
리턴 array

프로퍼티 상세

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

The Collection instance.
protected Collection,Doctrine\MongoDB $collection
리턴 Doctrine\MongoDB\Collection

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

protected Iterator,Doctrine\MongoDB $iterator
리턴 Doctrine\MongoDB\Iterator

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

Query options
protected array $options
리턴 array

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

Query structure generated by the Builder class.
protected array $query
리턴 array