What about injecting the repository directly? This allows the end user to re-define behaviour in the factory itself. Also, typehint `Doctrine\Common\Persistence\ObjectRepository` when doing so. This automatically unlocks MongoDB ODM users that want to use this functionality.