Skip to content

Loading…

DDC-1520: UnitOfWork->triggerEagerLoads raises SqlException #2152

Closed
doctrinebot opened this Issue · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user h-andreas:

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))));
        }
    }
@doctrinebot

Comment created by @beberlei:

Fixed.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.1.5 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.