Asmir Mustafic

Results 546 comments of Asmir Mustafic

Not everybody is using doctrine or a field for the type. Using a pure object oriented approach, you do not need a "type field" (as doctrine does) to have an...

`messageType` probabily is declared in your abstract class.. is it? have to put `@exclude` on `messageType`

Can you post the code of the abstract class and of a child class?

in answer you should use the abstract class... ```php $answer = $this->serializer->deserialize($msg->body, Message::class, 'json', DeserializationContext::create()->setGroups(['save'])); ``` Do you have in the JSON serialized representation a filed called `message_type` ?

as you can see there is not message type serialized in your JSON... this why the deserialization fails. Which version of the serializer are you using?

ah, yes, you forgot the `groups` for the discrimintor. ``` * @JMS\Discriminator(field = "message_type", map = { * "question" = "AppBundle\Entity\Message\Question", * "answer" = "AppBundle\Entity\Message\Answer", * "abuse" = "AppBundle\Entity\Message\Abuse", *...

it looks so.. https://github.com/schmittjoh/serializer/pull/579 introduced it and was merged on 3 Dec 2016 ... can you try to use the 1.5 rc?

> If I remove $type private field, it fails with this message >> Property AppBundle\Model\Query\Value\ObjectValue::$type does not exist you have to clean the cache in this case

@mever how would you decide the class to instantiate when deserializing that payload? A field for the type is used currently to decide which class to instantiate when doing the...

hmm, this sounds strange to me... the `find` method should be supposed to find entities using primary keys.... how is this feature going to behave if we have an entity...