Skip to content

Finalize query on Entity source #648

Open

Description

@fantoine

I would like to be able to update queries used on Entity sources before they are fetched.

The main reason is that I want to set fetch mode to eager to some relations I use on manipulated renders or custom columns. However I didn't see a way to update the query, but only the querybuilder.

Maybe, adding a method which could be overridden on Entity subclasses could be useful:

protected function finalizeQuery(Doctrine\ORM\Query $query) {}

Activity

  1. fantoine commented on Nov 21, 2014

    @fantoine
    ContributorAuthor

    Or it may also be a parameter on Column annotation.

  2. Abhoryo commented on Nov 21, 2014

    @Abhoryo
    Member

    Indeed, this is a great idea. L'd like to add this in the master version, can you do a PR.

  3. Abhoryo commented on Nov 21, 2014

    @Abhoryo
    Member

    I see that you can set the fetch mode in your entity directly.

    You only want for some case ?

  4. fantoine commented on Nov 21, 2014

    @fantoine
    ContributorAuthor

    Yes, I don't want to use the eager fetch mode every time, but specifically to some cases. I just want to optimize queries according to their usage.

    I'll try to do some pull requests but I'm not using the master branch on my project and can't switch to it for some reasons, so I can't promise anything.

  5. modified the milestone: 2.3 on Dec 13, 2015
  6. modified the milestones: , 2.4 on Dec 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions