public function current()
{
$mongoDocument = $this->getCursor()->current();
if (!$mongoDocument) {
return null;
}
if ($this->resultAsArray) {
return $mongoDocument;
}
return $this->collection->hydrate($mongoDocument, $this->isDocumentPoolUsed());
}
/** * @return \Sokil\Mongo\Document */ public function current() { return $this->cursor->current(); }