mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
Add option to change ProxyFactory behavior when an entity is not found #7191
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @VincentLanglet on GitHub (Jul 31, 2023).
Feature Request
Summary
Currently when the ProxyFactory does not found an entity, it throws an exception
https://github.com/doctrine/orm/blob/2.15.x/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L229-L238
In our project, we have a filter enabled by default
https://www.doctrine-project.org/projects/doctrine-orm/en/2.15/reference/filters.html#filters
which ends up sometimes no entity is returned for an id.
A simple use case can be "SoftDelete", the filter adds
If foo.deletedAt is not null, which means we can haveBut we have also more complex use cases.
We'd like to have
Could it be considered to introduce an option and change
https://github.com/doctrine/orm/blob/2.15.x/lib/Doctrine/ORM/Proxy/ProxyFactory.php#L229
to
Thanks.