So, when an Entity is loaded and you try to convert it to an array, it can be a problem if you have associations in that Entity. It will cause errors like
[29-Jan-2013 19:13:55] PHP Fatal error: Call to undefined method DoctrineProxy\__CG__\Dizkus_Entity_Topic::get_entityPersister() in /Applications/MAMP/htdocs/core.git/src/lib/Zikula/EntityAccess.php on line 76
because the properties of the Proxy are attempted to be converted in the Array. This is impossible since there are no getters for the proxy properties.
This PR attempts to correct that. The double check (if instanceof and if name) may be overkill. Probably just if (name) would work, but just being thorough 😄
(if instanceof and if name)
compensate for lazy-loaded associations using proxy classes.
@Guite - any comments?