Permalink
Browse files

Merge pull request #175 from simensen/undefined-index

targetDocument is not always available.
  • Loading branch information...
2 parents ce8a38b + 4bcf65f commit fa22ffd7552a99982fcc248f41d73d7619bee7e6 @dbu dbu committed Sep 12, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Doctrine/ODM/PHPCR/UnitOfWork.php
@@ -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;
}
}

0 comments on commit fa22ffd

Please sign in to comment.