APYDataGridBundle
APYDataGridBundle copied to clipboard
Finalize query on Entity source
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) {}
Or it may also be a parameter on Column annotation.
Indeed, this is a great idea. L'd like to add this in the master version, can you do a PR.
I see that you can set the fetch mode in your entity directly.
You only want for some case ?
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.