Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Serializer] Add docs for attributes context key#8830

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
weaverryan merged 3 commits intosymfony:3.3fromdunglas:patch-14
Dec 13, 2017

Conversation

@dunglas
Copy link
Member

Documentation forsymfony/symfony#18834

$serializer = new Serializer(array(new ObjectNormalizer()));

$data = $serializer->normalize($user, null, array('attributes' => array('familyName', 'company' => ['name'])));
// $data = array('familyName' => 'Dunglas', 'company' => ['name' => 'Les-Tilleuls.coop']);
Copy link
Member

Choose a reason for hiding this comment

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

'company' => ['name' ... ->'company' => array('name' ...

Only attributes that are not ignored (see below) are available.
If some serialization groups are set, only attributes allowed by those groups can be used.

As for groups, attributes can be applied during both the serialization and deserialization.
Copy link
Member

Choose a reason for hiding this comment

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

I don't understand what this phrase means -> "As for groups, attributes can be applied during both the serialization and deserialization."

Copy link
Member

@javiereguiluzjaviereguiluz left a comment

Choose a reason for hiding this comment

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

Perfectly explained, concise and with a good example.

Thank you!

@weaverryan
Copy link
Member

Thanks@dunglas!

@weaverryanweaverryan merged commitd48d6d4 intosymfony:3.3Dec 13, 2017
weaverryan added a commit that referenced this pull requestDec 13, 2017
…as, javiereguiluz)This PR was merged into the 3.3 branch.Discussion----------[Serializer] Add docs for attributes context keyDocumentation forsymfony/symfony#18834Commits-------d48d6d4 Minor rewordea211ab Review5d75696 [Serializer] Add docs for attributes context key
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

4 participants

@dunglas@weaverryan@javiereguiluz@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp