Details
Description
In the AbstractQuery::_getResultCacheId() function the following line generates the MD5 hash key:
return md5(implode(";", (array)$sql) . var_export($this->_params, true) . var_export($this->_hints, true)."&hydrationMode=".$this->_hydrationMode);
The issue is the use of var_export($this->_params, true); fails when one of the params is an instance of an Entity (which usually have recursive references).
To be honest I really don't know what solution there would be internally, if doctrine were to extend the proxy class to provide a "getIdentifier" or if the _getResultCacheId() could grab the identification of the Entity we could avoid this.
However beyond that potential idea really probably the best thing is to throw a giant warning text in the manual saying "if your'e using entities as parameters manually set your cache ids".
Maybe serializing instead of running a var_export?