Files
mongo-php-driver/docs/api/MongoDB/Query.php
Hannes Magnusson c9155e397b Add the actual implementation into the PHP API docs
This is used to generate the actual c classes.
- The CIMPL (Simple) section is the C Implementation
- The CEF (Chef) section is the C Definition
2014-07-16 17:59:26 +00:00

54 lines
1.6 KiB
PHP

<?php
namespace MongoDB;
/**
* Value object corresponding to a wire protocol OP_QUERY message.
*
* If and when queries become commands, we will need to introduce a new Query
* object, such as QueryCommand. At that point, the query will likely be
* constructed from a single document, which includes the arguments below in a
* similar fashion to findAndModify.
*/
final class Query
{
// See: http://docs.mongodb.org/meta-driver/latest/legacy/mongodb-wire-protocol/#op-query
const FLAG_NONE = 0x00;
const FLAG_TAILABLE_CURSOR = 0x01;
const FLAG_SLAVE_OK = 0x02;
const FLAG_OPLOG_REPLAY = 0x04;
const FLAG_NO_CURSOR_TIMEOUT = 0x08;
const FLAG_AWAIT_DATA = 0x10;
const FLAG_EXHAUST = 0x20;
const FLAG_PARTIAL = 0x40;
private $query;
private $selector;
private $flags;
private $skip;
private $limit;
/**
* Constructs a new Query
*
* @param array|object $query Query document
* @param array|object $selector Selector document
* @param integer $flags Query flags
* @param integer $skip Skip
* @param integer $limit Limit
*/
public function __construct($query, $selector = array(), $flags = self::FLAG_NONE, $skip = 0, $limit = 0)
{
$this->query = $query;
$this->selector = $selector;
$this->flags = (integer) $flags;
$this->skip = (integer) $skip;
$this->limit = (integer) $limit;
/*** CIMPL ***/
/*
phongo_query_init(intern, query, selector, flags, skip, limit TSRMLS_CC);
*/
/*** CIMPL ***/
}
}