I have quite a trivial question/problem, but I haven't found any satisfiable answer.
I have a simple entity in Doctrine 2 specifying configuration options (just ID, name and value). During rendering different pages throughout my code, I'm requesting different configuration options by name, which results in a query for each one of those requests.
But I actually need the values only in the template. So I want to somehow squeeze all the different calls into one query, that will execute and fetch all the options I've requested. I cannot build a custom DQL because I don't know which options will each page want (and building every combination seems stupid as hell to me).
I thought about a very naive implementation of some weird lazy loading, but it turns out I don't have much knowledge in this field. Is there any possibility for Doctrine to do this automatically?
Thanks for your time.