I don't see much differences actually, maybe other than the fact that the extract() method will recursively parse fields and call extract() when the value is an entity. Shouldn't it be the role of whatever formatter attempt to use extract() to recursively do this job, and not to the entity itself ?
I see only one use case where you'd call it within the ModelManager is when you insert one entity, which seems an error since in update you are using fields() instead., is there a bug or is there something I didn't understood ?
Moreover, the extract() method signature states:
Return an array with a representation of the object values. It is mostly used prior to a serialization in REST API or other string responses.
which is actually NOT what's happening in your code.
I don't see much differences actually, maybe other than the fact that the extract() method will recursively parse fields and call extract() when the value is an entity. Shouldn't it be the role of whatever formatter attempt to use extract() to recursively do this job, and not to the entity itself ?
I see only one use case where you'd call it within the ModelManager is when you insert one entity, which seems an error since in update you are using fields() instead., is there a bug or is there something I didn't understood ?
Moreover, the extract() method signature states:
which is actually NOT what's happening in your code.