Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add documentation for eager loading #147

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

Merged
Simperfit merged 2 commits into api-platform:master from meyerbaptiste:add_eager_loading_doc
Nov 18, 2016

Conversation

@meyerbaptiste
Copy link
Member

@meyerbaptiste meyerbaptiste commented Nov 17, 2016

No description provided.

#### Eager loading

By default Doctrine comes with [lazy loading](http://doctrine-orm.readthedocs.io/en/latest/reference/working-with-objects.html#by-lazy-loading).
Usually a killer time-saving feature and also a performance killer with large applications.
Copy link
Contributor

@Simperfit Simperfit Nov 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't that a little bit informal ?

meyerbaptiste reacted with thumbs down emoji
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with this statement.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

haha I do agree too, this feature should give more warning than it actually does

# ...
```

Be careful when you exceed your limit, it's often the result of circular references. The use of [serializer groups](serialization-groups-and-relations.md)
Copy link
Contributor

@Simperfit Simperfit Nov 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be careful when you exceed this limit, it's often caused by the result of a circular reference. [Serializer groups](serialization-groups-and-relations.md) can be a good solution to fix this issue


##### Force eager

As mentioned above, by default we force eager loading for all relations. This behaviour can be modified in the
Copy link
Contributor

@Simperfit Simperfit Nov 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behaviour can be modified with the configuration in order to apply it only on join relations having the ...

Copy link
Contributor

@Simperfit Simperfit Nov 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO this can still be better

##### Override at resource and operation level

When eager loading is enabled, whatever the status of the `force_eager` parameter, you can easily override it directly
from the configuration of each resource. For now, you can do this at the resource level, at the operations level, or both:
Copy link
Contributor

@Simperfit Simperfit Nov 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You say that there will be more way to do this, but you are not saying what will be next. IMO you don't need to say For now.

Copy link
Member

soyuka commented Nov 18, 2016

We may want to remove my part on performances as it's not right anymore because there are no partial select anymore https://github.com/meyerbaptiste/doc/blob/3216e636ec21917790456d9a2554edb96bed865c/core/performance.md#unserialized-properties-hydratation.

Copy link
Member Author

Done @soyuka.

soyuka reacted with thumbs up emoji

Copy link
Contributor

@Simperfit Simperfit merged commit f56f4e1 into api-platform:master Nov 18, 2016
@meyerbaptiste meyerbaptiste deleted the add_eager_loading_doc branch November 18, 2016 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dunglas dunglas dunglas approved these changes

@soyuka soyuka soyuka approved these changes

+1 more reviewer

@Simperfit Simperfit Simperfit approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /