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

Avoid multiple call to Admin::getObject and ModelManager::find #7766

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

VincentLanglet
Copy link
Member

@VincentLanglet VincentLanglet commented Mar 15, 2022

Subject

This is BC and supposed to reduce the amount of query.

assertObjectExists calls getObject which calls find on the ModelManager and execute a query.
Most of the time we assert the object exist then we're getting the object again.
If the assertion return the object, we can avoid the second call.

Changelog

### Changed
- Reduced number of ModelManager::find calls

@VincentLanglet VincentLanglet marked this pull request as ready for review March 16, 2022 21:45
@VincentLanglet VincentLanglet requested review from jordisala1991 and a team March 16, 2022 21:45
@VincentLanglet VincentLanglet merged commit 054b5cc into sonata-project:4.x Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants