/** * 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; }
public function valid() { return $this->cursor->valid(); }