private function applyOptionsToCursor(Cursor $cursor, QueryOptions $options)
 {
     if ($this->timeLimit !== null) {
         $cursor->timeout($this->timeLimit);
     }
     return $cursor->skip($options->getOffset())->limit($options->getLimit());
 }
コード例 #2
0
ファイル: Cursor.php プロジェクト: im286er/ent
 /**
  * Wrapper method for MongoCursor::skip().
  *
  * @see \Doctrine\MongoDB\Cursor::skip()
  * @see http://php.net/manual/en/mongocursor.skip.php
  * @param integer $num
  * @return self
  */
 public function skip($num)
 {
     $this->baseCursor->skip($num);
     return $this;
 }
コード例 #3
0
ファイル: Query.php プロジェクト: frogriotcom/brusite
 protected function prepareCursor(Cursor $cursor)
 {
     $cursor->limit($this->query['limit']);
     $cursor->skip($this->query['skip']);
     $cursor->sort($this->query['sort']);
     $cursor->immortal($this->query['immortal']);
     if (null !== $this->query['slaveOkay']) {
         $cursor->slaveOkay($this->query['slaveOkay']);
     }
     if ($this->query['snapshot']) {
         $cursor->snapshot();
     }
     foreach ($this->query['hints'] as $keyPattern) {
         $cursor->hint($keyPattern);
     }
     if ($this->query['eagerCursor'] === true) {
         $cursor = new EagerCursor($cursor);
     }
     return $cursor;
 }
コード例 #4
0
 protected function prepareCursor(Cursor $cursor)
 {
     $cursor->limit($this->query['limit']);
     $cursor->skip($this->query['skip']);
     $cursor->sort($this->query['sort']);
     $cursor->immortal($this->query['immortal']);
     $cursor->slaveOkay($this->query['slaveOkay']);
     if ($this->query['snapshot']) {
         $cursor->snapshot();
     }
     foreach ($this->query['hints'] as $keyPattern) {
         $cursor->hint($keyPattern);
     }
 }