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

custom type using a custom handler for primitives #385

Closed
sebastianreloaded opened this issue May 7, 2014 · 4 comments
Closed

custom type using a custom handler for primitives #385

sebastianreloaded opened this issue May 7, 2014 · 4 comments

Comments

@sebastianreloaded
Copy link

It's nice to have the @type annotation to format e.g. datetime database fields.

Why is it not possible to write a custom handler to modify primitives like string. My use case is to run htmlpurifier on certain fields that contain html.

I now use the event pre_serialize, but a type annotation would be more flexible. Is there a reason it is not possible to use a custom type?

@khallmark
Copy link

I'd like this also.

@FractalizeR
Copy link

I would like it also. I have a need, for example, to serialize/deserialize values of type Carbon into a string of predefined format. I would happily write a serialization/deserialization handler for the type.

@nnmer
Copy link

nnmer commented Jun 16, 2015

The same here.
Always getting Logic Exception "Expected object but got string. Do you have the wrong @type mapping or could this be a Doctrine many-to-many relation?"

@goetas
Copy link
Collaborator

goetas commented Feb 22, 2017

solved with schmittjoh/serializer#610

@goetas goetas closed this as completed Feb 22, 2017
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

5 participants