Jira issue originally created by user ambis:
Ok, my problem is this:
I have created a Query object. Now I'd like to get it's result cache driver.
1) Ask QueryCacheProfile for the driver. I can, but it's never populated by default so I always get just NULL.
2) Ask Query with getResultCacheDriver(), but wait, I can't, that's now deprecated
3) Ask from EM's configuration the result cache driver. This always works.
I propose that either the QueryCacheProfile is always populated with the Query's default result cache impl unless specifically overridden for the QueryCacheProfile
Make getResultCacheDriver() not deprecated. Like the other two related methods, they are not deprecated, why should this one. Calling this could populate the QueryCacheProfile for future use like all the other (get cache ttl, id) methods.
My problem with with option 3) is "leaving the context of my method and the Query" (mentally of course). Why should I have to go poke around in EM's configuration when the result cache IS (or is easily obtainable behind the scenes) in the query object anyways?
Comment created by @beberlei:
Weird, this code looks very strange. I will check and fix that before the 2.2 RC release.
The default result cache is now passed to any new query cache profile. The following API is now working as expected:
$cache = $query->getQueryCacheProfile()->getResultCacheDriver();
Issue was closed with resolution "Fixed"
Comment created by ambis:
That's perfect! Thank you!