-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Better explain the EntityManager::getReference()
method
#10797
Comments
@flack what would have helped you, what would you like to have known before, what warning signs do you deem appropriate? |
@mpdude I was about to open a ticket about that, too (was thinking something along the lines of " A stern warning in the documentation can't hurt, but realistically, it won't prevent many errors either. I suppose there are no sanity checks in this method because of performance, but it's a bit absurd that I can have an entity with an autoincrement ID field, and then get a reference for id It would be nice it doctrine had some way of handling these invalid references gracefully. E.g. if |
How terrible would it be to make public function getReference($entityName, $id, $skip_id_check = false); |
This tries to fix doctrine#10797.
As one takeaway from doctrine#3037 (comment) and doctrine#843, we should look into better explaining the `EntityManager::getReference()` method, it’s semantics, caveats and potential responsibilities placed on the user. This PR tries to do that, so it fixes doctrine#10797.
* Explain `EntityManager::getReference()` peculiarities As one takeaway from #3037 (comment) and #843, we should look into better explaining the `EntityManager::getReference()` method, it’s semantics, caveats and potential responsibilities placed on the user. This PR tries to do that, so it fixes #10797. * Update docs/en/reference/advanced-configuration.rst Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr> --------- Co-authored-by: Grégoire Paris <postmaster@greg0ire.fr>
As one takeaway from #3037 (comment) and #843, we should look into better explaining the
EntityManager::getReference()
method, it’s semantics, caveats and potential responsibilities placed on the user.The text was updated successfully, but these errors were encountered: