コード例 #1
0
ファイル: Cursor.php プロジェクト: im286er/ent
 /**
  * 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;
 }
コード例 #2
0
 /** @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;
 }