Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1520

UnitOfWork->triggerEagerLoads raises SqlException

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.4
    • Fix Version/s: 2.1.5
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      If all entities that are marked to be loaded eagerly are loaded through other references before UnitOfWork->triggerEagerLoads is executed an exception will be thrown as the value of the array is empty.

          public function triggerEagerLoads()
          {
              if (!$this->eagerLoadingEntities) {
                  return;
              }
      
              // avoid infinite recursion
              $eagerLoadingEntities = $this->eagerLoadingEntities;
              $this->eagerLoadingEntities = array();
      
              foreach ($eagerLoadingEntities AS $entityName => $ids) {
                  $class = $this->em->getClassMetadata($entityName);
                  $this->getEntityPersister($entityName)->loadAll(array_combine($class->identifier, array(array_values($ids))));
              }
          }
      

        Activity

        Hide
        Benjamin Eberlei added a comment -

        Fixed.

        Show
        Benjamin Eberlei added a comment - Fixed.

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Andreas Hörnicke
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: