Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

targetDocument is not always available.

  • Loading branch information...
commit 4bcf65f23e3781fd020d57061256d3edf4c48d87 1 parent 8cd7a38
@simensen simensen authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/Doctrine/ODM/PHPCR/UnitOfWork.php
View
3  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;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.