Skip to content

[WCM] Added documentation to cover PR #6951 on serializer component. #2270

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

Merged

Conversation

marcosQuesada
Copy link
Contributor

.. versionadded:: 2.3
That PR covers PR #6951, enables camelCase formater on deserialize process , that way attributes as attribute_name could be implemented as attributteName parameter, with getAttributeName and setAttributeName, giving different formating option from setAttribute_name getAttribute_name.

Q A
Doc fix? no
New docs? yes (symfony/symfony#6951)
Applies to 2.3
Fixed tickets no ticket

@marcosQuesada
Copy link
Contributor Author

I've added documentation for setIgnoredAttributes too, thx.

@@ -96,6 +96,16 @@ The first parameter of the :method:`Symfony\\Component\\Serializer\\Serializer::
is the object to be serialized and the second is used to choose the proper encoder,
in this case :class:`Symfony\\Component\\Serializer\\Encoder\\JsonEncoder`.

As an option, there's a way to ignore attributes from the origin object to be serialized,
to remove those attributes use setIgnoredAttributes method on normalizer definition::

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, add a use statement for the JsonEncoder and GetSetMethodNormalizer here.

@marcosQuesada
Copy link
Contributor Author

I was using github editor, sorry about that! Updated!

@marcosQuesada
Copy link
Contributor Author

Hi @wouterj !

PR#6951 has been merged (symfony/symfony#6951) , is there anything else to modify on this docu? Any improvement?
thx!

$normalizer->setIgnoredAttributes(array('age'));
$encoder = new JsonEncoder();

$serializer = new Serializer(array($normalizer), array($encoder));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot the use statement for this class

@wouterj
Copy link
Member

wouterj commented Mar 23, 2013

ping @weaverryan except these last comments, it ready to be merged.

@marcosQuesada
Copy link
Contributor Author

Updated @wouterj Thx! /cc: @weaverryan

weaverryan added a commit that referenced this pull request Apr 26, 2013
…melcase

[WCM] Added documentation to cover PR #6951 on serializer component.
@weaverryan weaverryan merged commit a66f99b into symfony:master Apr 26, 2013
@weaverryan
Copy link
Member

Hi Marcos!

I've merged in this PR with minor changes at sha: 047b9fe

Thanks for this nice feature!

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

Successfully merging this pull request may close these issues.

3 participants