Skip to content

Paginator does not work with Mongodb ODM > 1.0.0-beta10@dev #107

Closed
@MuntzMathias

Description

@MuntzMathias

Hi,
DoctrineMongoODMModule/Paginator/Adapter/DoctrinePaginator
does not work since version mongodb-odm:1.0.0-beta10

This is due to a change in the Doctrine/ODM/MongoDB/DocumentRepository, the "findBy" function does not return a MongoODM/Cursor but an Array.

In BETA 9

/**
     * Finds documents by a set of criteria.
     *
     * @param array        $criteria Query criteria
     * @param array        $sort     Sort array for Cursor::sort()
     * @param integer|null $limit    Limit for Cursor::limit()
     * @param integer|null $skip     Skip for Cursor::skip()
     * @return Cursor
     */
    public function findBy(array $criteria, array $sort = null, $limit = null, $skip = null)
    {
        return $this->uow->getDocumentPersister($this->documentName)->loadAll($criteria, $sort, $limit, $skip);
    }

In BETA 10

/**
     * Finds documents by a set of criteria.
     *
     * @param array        $criteria Query criteria
     * @param array        $sort     Sort array for Cursor::sort()
     * @param integer|null $limit    Limit for Cursor::limit()
     * @param integer|null $skip     Skip for Cursor::skip()
     *
     * @return array
     */
    public function findBy(array $criteria, array $sort = null, $limit = null, $skip = null)
    {
        return $this->getDocumentPersister()->loadAll($criteria, $sort, $limit, $skip)->toArray(false);
    }

There is a solution to use the latest version of mongo-ODM (ex: BETA11)?

Metadata

Metadata

Assignees

Labels

BugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions