/** * 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()); } }
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; }
/** * 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); } }
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; }