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

Deserialize with object refs #62

Closed
tarjei opened this issue Mar 20, 2013 · 4 comments
Closed

Deserialize with object refs #62

tarjei opened this issue Mar 20, 2013 · 4 comments

Comments

@tarjei
Copy link
Contributor

tarjei commented Mar 20, 2013

Hi, Quite often I see the need to deserialize objects where the object is only defined by it's id.

For example:

class User {

/* @var Customer */
protected $customer; 

}

here I do not want to pass customer back and forth for deserialization, but I want to be able to keep the refrence when I update the user object.

Would it be possible to have an annotation for defining that this object should be deserialized to an entity?

@stof
Copy link
Contributor

stof commented Mar 20, 2013

@Type('object_reference') and then registering a custom handler for the type object_reference

@tarjei
Copy link
Contributor Author

tarjei commented Mar 20, 2013

Ok, is it possible to create a generalized handler for this usecase?

@schmittjoh
Copy link
Owner

We have the DoctrineObjectConstructor which allows you to do that.

@tarjei
Copy link
Contributor Author

tarjei commented May 16, 2013

Ok, would it be possible to get some documentation on that?

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

3 participants