Skip to content

Commit

Permalink
Merge pull request #175 from simensen/undefined-index
Browse files Browse the repository at this point in the history
targetDocument is not always available.
  • Loading branch information
dbu committed Sep 12, 2012
2 parents ce8a38b + 4bcf65f commit fa22ffd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Doctrine/ODM/PHPCR/UnitOfWork.php
Expand Up @@ -336,7 +336,8 @@ public function createDocument($className, NodeInterface $node, array &$hints =
}

if (count($referencedNodes) > 0) {
$coll = new ReferenceManyCollection($this->dm, $referencedNodes, $assocOptions['targetDocument']);
$targetDocument = isset($assocOptions['targetDocument']) ? $assocOptions['targetDocument'] : null;
$coll = new ReferenceManyCollection($this->dm, $referencedNodes, $targetDocument);
$documentState[$class->associationsMappings[$assocName]['fieldName']] = $coll;
}
}
Expand Down

0 comments on commit fa22ffd

Please sign in to comment.