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

FlexibleEntityInterface::fields() and FlexibleEntityInterface::extract() are somehow a bit redundant #65

Open
pounard opened this issue May 10, 2016 · 1 comment

Comments

@pounard
Copy link

pounard commented May 10, 2016

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.

@chanmix51
Copy link
Member

That’s true, I still don’t know where a better system should be set up (probably in version 3).

@chanmix51 chanmix51 added this to the 3.0 milestone Feb 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants