Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #175 from simensen/undefined-index

targetDocument is not always available.
  • Loading branch information...
commit fa22ffd7552a99982fcc248f41d73d7619bee7e6 2 parents ce8a38b + 4bcf65f
David Buchmann dbu authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/Doctrine/ODM/PHPCR/UnitOfWork.php
3  lib/Doctrine/ODM/PHPCR/UnitOfWork.php
View
@@ -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;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.