Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in circular references (function nesting level of '100' reached) #72

Closed
joanteixi opened this issue Feb 1, 2012 · 2 comments
Closed

Comments

@joanteixi
Copy link

Hello,

i'm not sure if this is the correct place to comment this issue. I will try to explain the problem:
I've a User class with followers and people to follow throught another class (Follow entity). In follow entity there're of courser references to User entity... There're more entites related like Follow entity in my model... so... when i try to serialize it I get an error (function nesting level...) due (i supose) to the circular references.

I see in documentation that this bundle can handle with circular references of objects so I supose that I have some problem. Here is the example in pseudoPHP on my controller:

    $user = entitityRepository->find(1);
    $serializer = $this->get('serializer');
    $json = $serializer->serialize($user, 'json');

...error... :(

@schmittjoh
Copy link
Owner

The bundle automatically breaks circular references. The problem might indeed be that your object graph is indeed too deep and consequentially, xdebug terminates the execution.

@joanteixi
Copy link
Author

Thanks... I supose that the best solution is use the ExclusionPolicy as Annotations. Thanks for you great job with your bundles

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants