/** * Wrapper method for MongoCursor::getNext(). * * If configured, the result may be a hydrated document class instance. * * @see \Doctrine\MongoDB\Cursor::getNext() * @see http://php.net/manual/en/mongocursor.getnext.php * @return array|object|null */ public function getNext() { $next = $this->baseCursor->getNext(); if ($next !== null && $this->hydrate) { return $this->unitOfWork->getOrCreateDocument($this->class->name, $next, $this->unitOfWorkHints); } return $next; }
/** @override */ public function getNext() { $next = parent::getNext(); if ($next && $this->hydrate) { return $this->unitOfWork->getOrCreateDocument($this->class->name, $next, $this->hints); } return $next ? $next : null; }