Exactly what I was looking for, and implementation required very little modification to my existing code.
Thanks a bunch! On Thursday, February 20, 2014 2:19:47 PM UTC-6, Stephen Leavitt wrote: > > I'll have a look at that and see if I can make it work. > > Thanks! > > On Thursday, February 20, 2014 2:00:16 PM UTC-6, Jàπ (Jasper N. Brouwer) > wrote: >> >> Have a look at EntityManager::getReference() >> >> If an entity has been loaded already, getReference() will return that >> entity. But if it isn't loaded yet, it will return a Proxy. I think this is >> what you're searching for :) >> >> -- >> Jasper N. Brouwer >> (@jaspernbrouwer) >> >> >> On 20 Feb 2014, at 20:42, Stephen Leavitt <[email protected]> wrote: >> >> > Ok, I've pretty much solved my issue by keeping tracking of an integer >> field on the entity for storing the primary key of the entity on the other >> entity manager, and implementing an entity listener as a service in symfony >> using prePersist, preUpdate, and postLoad events, and this seems to work >> well. >> > >> > The one question I do have is if it is possible to retrieve an entity >> as an entity proxy intentionally, so that way I can treat the linked entity >> as an association and load it using lazy loading even though it technically >> isn't an association. If this is not possible or is too difficult to >> implement, I'm ok with that, as I'm not encountering any issues currently. >> Might be a case of premature optimization on my part, but I was just >> wondering if anyone had ever done it. >> > >> > Thanks. >> >> -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/groups/opt_out.
