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

Modify result #469

Open
fnxnet opened this issue Jul 17, 2015 · 2 comments
Open

Modify result #469

fnxnet opened this issue Jul 17, 2015 · 2 comments

Comments

@fnxnet
Copy link

fnxnet commented Jul 17, 2015

I was looking for way how to modify already serialized data.

I've registered PostSerialize event listener. Unfortunately I have no access from inside of the listener to "data" and modify it (unset variables, wrap data, etc...). I guess it would be greate to have getData() and setData() methods in JMS\Serializer\JsonSerializationVisitor.

What I was trying to archieve is to wrap serialized data like:

[
    'test' => [
        'foo' => 'bar'
    ]
]

into 'parent' to get:

[
    'parent' => [
        'test' => [
            'foo' => 'bar'
        ]
    ]
]

If you get any bether idea plese let me know.

@fnxnet
Copy link
Author

fnxnet commented Jul 30, 2015

Any idea how I can obtain required result?

@lobboblaw
Copy link

I'm curious about this as well. It seems like a trivial method, but maybe it's missing for a reason?

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

No branches or pull requests

3 participants