Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing YamlDriver and XmlDriver with no target document is specified.

  • Loading branch information...
commit 8c8437a9113a0849f38db0664f66dd407a497918 1 parent 20033a3
Jonathan H. Wage jwage authored
4 lib/Doctrine/ODM/MongoDB/Mapping/Driver/XmlDriver.php
View
@@ -144,7 +144,7 @@ private function _getMappingFromEmbed($embed, $type)
$mapping = array(
'type' => $type,
'embedded' => true,
- 'targetDocument' => (string) $attributes['target-document'],
+ 'targetDocument' => isset($attributes['target-document']) ? (string) $attributes['target-document'] : null,
'name' => (string) $attributes['field'],
);
return $mapping;
@@ -161,7 +161,7 @@ private function _getMappingFromReference($reference, $type)
'cascade' => $cascade,
'type' => $type,
'reference' => true,
- 'targetDocument' => (string) $attributes['target-document'],
+ 'targetDocument' => isset($attributes['target-document']) ? (string) $attributes['target-document'] : null,
'name' => (string) $attributes['field'],
);
return $mapping;
6 lib/Doctrine/ODM/MongoDB/Mapping/Driver/YamlDriver.php
View
@@ -138,7 +138,7 @@ private function _getMappingFromEmbed($fieldName, $embed, $type)
'name' => $fieldName,
'embedded' => true,
'type' => $type,
- 'targetDocument' => $embed['targetDocument'],
+ 'targetDocument' => isset($embed['targetDocument']) ? $embed['targetDocument'] : null,
);
return $mapping;
}
@@ -149,7 +149,7 @@ private function _getMappingFromReference($fieldName, $reference, $type)
'cascade' => isset($reference['cascade']) ? $reference['cascade'] : null,
'type' => $type,
'reference' => true,
- 'targetDocument' => $reference['targetDocument'],
+ 'targetDocument' => isset($reference['targetDocument']) ? $reference['targetDocument'] : null,
'name' => $fieldName,
);
return $mapping;
@@ -159,4 +159,4 @@ protected function _loadMappingFile($file)
{
return \Symfony\Components\Yaml\Yaml::load($file);
}
-}
+}
Please sign in to comment.
Something went wrong with that request. Please try again.