From 9441e063aa0c16b7fd5fadb4531f594210f718e3 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Fri, 18 Apr 2014 03:04:04 +0000 Subject: [PATCH] Updated XML Exporter to deal with some HHVM weirdness. --- .../ORM/Tools/Export/Driver/XmlExporter.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php index 8d1bfc37c..a405776ed 100644 --- a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php +++ b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php @@ -269,7 +269,7 @@ class XmlExporter extends AbstractExporter if (isset($associationMapping['fetch'])) { $associationMappingXml->addAttribute('fetch', $this->_getFetchModeString($associationMapping['fetch'])); } - + $cascade = array(); if ($associationMapping['isCascadeRemove']) { $cascade[] = 'cascade-remove'; @@ -396,15 +396,16 @@ class XmlExporter extends AbstractExporter * @param array $options */ private function exportTableOptions(\SimpleXMLElement $parentXml, array $options) - { + { foreach ($options as $name => $option) { - $optionXml = $parentXml->addChild('option'); + $optionXml = is_array($option) + ? $parentXml->addChild('option') + : $parentXml->addChild('option', (string) $option); + $optionXml->addAttribute('name', (string) $name); - + if (is_array($option)) { $this->exportTableOptions($optionXml, $option); - } else { - $optionXml[0] = (string) $option; } } }