/** * 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()); } }
/** * 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); } }
/** * Return the query criteria. * * @see \Doctrine\MongoDB\Cursor::getQuery() * @return array */ public function getQuery() { return $this->baseCursor->getQuery(); }
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; }
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; }