Inheritance: implements Iterator, implements Countable
Esempio n. 1
0
 /**
  * Create document query builder
  *
  * @param $callable callable|null Function to configure query builder&
  * @return \Sokil\Mongo\Cursor|\Sokil\Mongo\Expression
  */
 public function find($callable = null)
 {
     /** @var \Sokil\Mongo\Cursor $cursor */
     $cursor = new Cursor($this, array('expressionClass' => $this->definition->getExpressionClass(), 'batchSize' => $this->definition->getOption('batchSize'), 'clientTimeout' => $this->definition->getOption('cursorClientTimeout'), 'serverTimeout' => $this->definition->getOption('cursorServerTimeout')));
     if (is_callable($callable)) {
         $callable($cursor->getExpression());
     }
     return $cursor;
 }
Esempio n. 2
0
 public function valid()
 {
     return $this->cursor->valid();
 }