Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2810

Doctrine\ORM\EntityNotFoundException - Entity was not found.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Invalid
    • Affects Version/s: 2.4
    • Fix Version/s: None
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None
    • Environment:
      Linux 2.6.32-358.18.1.el6.x86_64 #1 SMP Fri Aug 2 17:04:38 EDT 2013 x86_64 x86_64 x86_64 GNU/Linux
      Server version: Apache/2.2.22 (Unix)
      PHP 5.3.3 (cli) (built: Jul 12 2013 04:36:18)

      Description

      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;

        Activity

        Hide
        Benjamin Eberlei added a comment -

        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.

        Show
        Benjamin Eberlei added a comment - 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.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Timothy Lorens
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: