On 23 September 2014 01:12, Stan Lemon <[email protected]> wrote: > Marco, > The constructor is bypassed because the entity is being deserialized from > json string, so basically what I’m trying to do is take the json data - > deserialize it and make sure that some defaults like the object creation > time get set >
Yep, but some public API will still be called for that. > before I store it in the database. > And that's where I wanted to focus: `prePersist` is "when I store it in the database", while, as you already say, the correct version is "before I store it in the database". I suggest doing that during the un-serialization ;-) Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
