Jira issue originally created by user lstrojny:
Doctrine\ORM\Query should not be directly extendable but it would be nice to decorate query objects and add additional methods. Use cases are e.g. doctrine-fun (see https://github.com/lstrojny/doctrine-fun/blob/master/src/Doctrine/Fun/Query.php) or even cases where users want to add domain specific methods. As Doctrine\ORM\Query is final it is not so easy to decorate correctly. I would propose:
Comment created by lstrojny:
Comment created by gcds:
Any changes on this?
Comment created by @ocramius:
The EntityManagerInterface now allows producing custom query objects: just requires a custom createQuery or createQueryBuilder API.
Yes, but you can't extend Doctrine\ORM\Query object, and many places expects Doctrine\ORM\Query not your custom query object
Oh, I see what you mean.
Yes, those still require patching, so I suggest getting your hands dirty and trying with a pull request ;-)