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