mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-2810: Doctrine\ORM\EntityNotFoundException - Entity was not found. #3511
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 @doctrinebot on GitHub (Nov 21, 2013).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user icebrkr:
Doctrine\ORM\EntityNotFoundException - Entity was not found.
/zf2/framework/Infrastructure/Vendor/doctrine/orm/lib/Doctrine/ORM/Proxy/ProxyFactory.php:177
OneToOne join-side doesn't contain a matching record. One would assume this would just continue with an empty proxy object (full of null properties).
The offending line of code is on line 750 of DOctrine\ORM\BasicEntityPersister.php.
A quick fix/work-around was to replace the return null value with $entity which seems to be the object proxy class.
Change this:
return $entities ? $entities[0] : null;
To This:
return $entities ? $entities[0] : $entity;
@doctrinebot commented on GitHub (Dec 13, 2013):
Comment created by @beberlei:
A proxy object is created, when the value on the foreign key is != NULL. If you are having 0 thhere fore example, this problem will happen. We wont fix this however as this can cause serious issues over the project. Your database schema has to conform with Doctrine in this regard, its a requirement.
@doctrinebot commented on GitHub (Dec 13, 2013):
Issue was closed with resolution "Invalid"