php - Serialized proxy classes Doctrine 2 -
Is the principle "2" likely to get a "full" object rather than a proxy class?
Because I am sorting the organization (and relations), but when I deserialize, I just get a proxy class back.
What I'm querying:
> Never tried anything individually (but they were able to dictate 2 on the fingers No), but should move, you'll always load those related objects in this way. Alternatively, try accessing the affiliated institutions before serializing. Just like if you follow the advice to finish the related object collection (and you really should follow it), you can simply access it with Note that this is not a complete code sample, but I think how you can map associations anyway, more detailed descriptions and code samples for review and chapters . public function getSnippet ($ id) {return $ this- & gt; GetEntityManager () - & gt; GetRepository ('GvnSnippetryBundle: Snippet') - & gt; FindOneBy (array ('id' = & gt; $ id)); }
$ snippet-> gtc:, didYouCallFunctionThatReturnCollection () can do. The principle has blocked the request of
archive check that it is full of proxy and it is loaded automatically, so, it should be something like this:
Class snippet {// other announcements / ** wantomy (target = 'blah, ...) * / protected $ associations; Public Function getAssociations () {Return $ this- & gt; Associations; // fills the proxy with the actual data}} Public function getSnippet ($ id) {$ snippet = $ this- & gt; GetEntityManager () - & gt; GetRepository ('GvnSnippetry bundle: snippet') - & gt; FindOneBy (array ('id' = & gt; $ id)); $ Snippet- & gt; GetAssociations (); // Only one association $ snippet- & gt; GetAssociations2 (); // Snippet $ refund on it; }
Comments
Post a Comment