Skip to content

Serializer example with Doctrine Entity #2225

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

Closed
gkatsanos opened this issue Feb 10, 2013 · 0 comments
Closed

Serializer example with Doctrine Entity #2225

gkatsanos opened this issue Feb 10, 2013 · 0 comments
Labels
actionable Clear and specific issues ready for anyone to take them. bug

Comments

@gkatsanos
Copy link

Hello,
I was trying to make a doctrine entity -> json conversion work with the Serializer bundle, I was following both http://symfony.com/doc/current/components/serializer.html and http://jmsyst.com/libs/serializer#usage . The code mentions several times this:
$serializer->serialize($person, 'json'); or more generally, this: $serializer->serialize($data, 'json'); .
It seems that in order for it to work, you need to
$avariable = $serializer->serialize($data, 'json'); and return that $avariable in the response.
I understand it might seem trivial for PHP-ers but as it's a guide for people starting up, why not add a line with the proper return response? (would save time:))
Thanks!

weaverryan pushed a commit that referenced this issue Mar 31, 2013
Improve serialization example

| Q             | A
| ------------- | ---
| Doc fix?      | yes
| New docs?     | yes
| Applies to    | all
| Fixed tickets | #2225
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. bug
Projects
None yet
Development

No branches or pull requests

2 participants