コード例 #1
0
 /**
  * Wraps the supplied base cursor as an ODM one.
  *
  * @param Doctrine\MongoDB\Cursor $cursor The base cursor
  *
  * @return Cursor An ODM cursor
  */
 private function wrapCursor(BaseCursor $cursor)
 {
     if ($cursor instanceof BaseLoggableCursor) {
         return new LoggableCursor($this->dm->getConnection(), $this->collection, $this->dm->getUnitOfWork(), $this->class, $cursor, $cursor->getQuery(), $cursor->getFields(), $this->dm->getConfiguration()->getRetryQuery(), $cursor->getLoggerCallable());
     } else {
         return new Cursor($this->dm->getConnection(), $this->collection, $this->dm->getUnitOfWork(), $this->class, $cursor, $cursor->getQuery(), $cursor->getFields(), $this->dm->getConfiguration()->getRetryQuery());
     }
 }
コード例 #2
0
 /**
  * Wraps the supplied base cursor as an ODM one.
  *
  * @param Doctrine\MongoDB\Cursor $cursor The base cursor
  *
  * @return Cursor An ODM cursor
  */
 private function wrapCursor(BaseCursor $cursor)
 {
     $mongoCursor = $cursor->getMongoCursor();
     if ($cursor instanceof BaseLoggableCursor) {
         return new LoggableCursor(
             $mongoCursor,
             $this->uow,
             $this->class,
             $cursor->getLoggerCallable(),
             $cursor->getQuery(),
             $cursor->getFields()
         );
     } else {
         return new Cursor($mongoCursor, $this->uow, $this->class);
     }
 }
コード例 #3
0
ファイル: Cursor.php プロジェクト: im286er/ent
 /**
  * Return the query criteria.
  *
  * @see \Doctrine\MongoDB\Cursor::getQuery()
  * @return array
  */
 public function getQuery()
 {
     return $this->baseCursor->getQuery();
 }
コード例 #4
0
ファイル: Query.php プロジェクト: noikiy/inovi
 private function wrapCursor(BaseCursor $baseCursor, array $hints)
 {
     if ($baseCursor instanceof BaseLoggableCursor) {
         $cursor = new LoggableCursor($this->dm->getConnection(), $this->collection, $this->dm->getUnitOfWork(), $this->class, $baseCursor, $baseCursor->getQuery(), $baseCursor->getFields(), $this->dm->getConfiguration()->getRetryQuery(), $baseCursor->getLoggerCallable());
     } else {
         $cursor = new Cursor($this->dm->getConnection(), $this->collection, $this->dm->getUnitOfWork(), $this->class, $baseCursor, $baseCursor->getQuery(), $baseCursor->getFields(), $this->dm->getConfiguration()->getRetryQuery());
     }
     $cursor->hydrate($this->hydrate);
     $cursor->setHints($hints);
     return $cursor;
 }
コード例 #5
0
 private function wrapCursor(BaseCursor $baseCursor)
 {
     $mongoCursor = $baseCursor->getMongoCursor();
     if ($baseCursor instanceof BaseLoggableCursor) {
         $cursor = new LoggableCursor($mongoCursor, $this->dm->getUnitOfWork(), $this->class, $baseCursor->getLoggerCallable(), $baseCursor->getQuery(), $baseCursor->getFields());
     } else {
         $cursor = new Cursor($mongoCursor, $this->dm->getUnitOfWork(), $this->class);
     }
     $cursor->hydrate($this->hydrate);
     $cursor->refresh($this->refresh);
     return $cursor;
 }