本文整理汇总了PHP中MongoCursor::rewind方法的典型用法代码示例。如果您正苦于以下问题:PHP MongoCursor::rewind方法的具体用法?PHP MongoCursor::rewind怎么用?PHP MongoCursor::rewind使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MongoCursor
的用法示例。
在下文中一共展示了MongoCursor::rewind方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: rewind
/**
* @throws Exception\RuntimeException
* @return void
*/
public function rewind()
{
// if ( $this -> statementMode == self::STATEMENT_MODE_FORWARD && $this -> position > 0 )
// {
// throw new Exception\RuntimeException(
// 'This result is a forward only result set, calling rewind() after moving forward is not supported'
// );
// }
$this->resource->rewind();
$this->currentData = $this->resource->current();
$this->currentComplete = true;
$this->position = 0;
}
示例2: getCursor
/**
*
* @return \MongoCursor
*/
private function getCursor()
{
if ($this->cursor) {
return $this->cursor;
}
$this->cursor = $this->collection->getMongoCollection()->find($this->expression->toArray(), $this->fields);
if ($this->skip) {
$this->cursor->skip($this->skip);
}
if ($this->limit) {
$this->cursor->limit($this->limit);
}
if ($this->options['batchSize']) {
$this->cursor->batchSize($this->options['batchSize']);
}
if ($this->options['clientTimeout']) {
$this->cursor->timeout($this->options['clientTimeout']);
}
if ($this->options['serverTimeout']) {
$this->cursor->maxTimeMS($this->options['clientTimeout']);
}
if ($this->sort) {
$this->cursor->sort($this->sort);
}
if ($this->hint) {
$this->cursor->hint($this->hint);
}
// log request
if ($this->client->hasLogger()) {
$this->client->getLogger()->debug(get_called_class() . ': ' . json_encode(array('collection' => $this->collection->getName(), 'query' => $this->expression->toArray(), 'project' => $this->fields, 'sort' => $this->sort)));
}
$this->cursor->rewind();
// define read preferences
if ($this->readPreference) {
$this->cursor->setReadPreference($this->readPreference['type'], $this->readPreference['tagsets']);
}
return $this->cursor;
}
示例3: rewind
/**
* Rewind the Iterator to the first element
* @return void
* @since v1.3.4
*/
public function rewind()
{
$this->_cursor->rewind();
}
示例4: rewind
/**
* Reset the MongoCursor to the beginning
* @return EMongoCursor
*/
public function rewind()
{
$this->cursor->rewind();
return $this;
}
示例5: rewind
/**
* Required for Iterator Interface
* Runs the query on the database and rewinds the cursor to
*/
public function rewind()
{
$this->runQry();
$this->cursor->rewind();
}
示例6: rewind
/**
* {@inheritdoc}
*/
public function rewind()
{
$this->mongoCursor->rewind();
}
示例7: rewind
/**
* rewind.
*/
public function rewind()
{
$this->logQuery();
return parent::rewind();
}
示例8: rewind
/**
* Iterator::rewind
*/
public function rewind()
{
$this->myResultCursor->rewind();
}
示例9: rewind
/**
* Iterator interface rewind (used in foreach)
*
*/
public function rewind()
{
$this->cursor->rewind();
$this->position = 0;
}
示例10: rewind
/**
* 把游标指到第一条记录
* @return null
*/
public function rewind()
{
return $this->oMongoCursor->rewind();
}