Skip to content

Prevent extra sql queries from to-many and to-one ORM relations #634

Open
@cassianotartari

Description

@cassianotartari

Hi!

I'm running "knplabs/knp-paginator-bundle": "2.8.0" pagination results in a list view. I'd like to know if it's possible to prevent run extra sql queries from to-many and to-one ORM relations. I've tried to ->setHint(UsesPaginator::HINT_FETCH_JOIN_COLLECTION, false) with no success. For example: I have a entity Order that has one-to-one relation with Cart. When I run my list with orders the class Knp\Component\Pager\Event\Subscriber\Paginate\Doctrine\ORM\QuerySubscriber\UsesPaginator make a extra sql query for each relation of Order. Is there a way to prevent this extra queries?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions