From a164c6a2cd1ce917349394eff72e3f73e5e88609 Mon Sep 17 00:00:00 2001 From: meus Date: Wed, 27 Jun 2007 08:14:05 +0000 Subject: [PATCH] fixed some in the export xml functions to correctly show records if no ignore_fields are set and to use database table name and not classname as basis for xml containers --- lib/Doctrine/Lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/Lib.php b/lib/Doctrine/Lib.php index 013725271..ccad93e8f 100644 --- a/lib/Doctrine/Lib.php +++ b/lib/Doctrine/Lib.php @@ -85,7 +85,7 @@ class Doctrine_Lib public static function getCollectionAsXml(Doctrine_Collection $collection, SimpleXMLElement $incomming_xml = null){ - $collectionName = Doctrine_Lib::plurelize($collection->getTable()->name); + $collectionName = Doctrine_Lib::plurelize($collection->getTable()->tableName); if ( ! isset($incomming_xml)) { $new_xml_string = "<" . $collectionName . ">"; @@ -120,7 +120,7 @@ class Doctrine_Lib */ public static function getRecordAsXml(Doctrine_Record $record, SimpleXMlElement $incomming_xml = NULL) { - $recordname = $record->getTable()->name; + $recordname = $record->getTable()->tableName; if (!isset($incomming_xml)) { $new_xml_string = "<" . $recordname . ">"; $xml = new SimpleXMLElement($new_xml_string); @@ -132,7 +132,7 @@ class Doctrine_Lib } $xml_options = $record->option("xml"); foreach ($record->getData() as $field => $value) { - if (isset($xml_options["ignore_fields"]) && !in_array($field, $xml_options["ignore_fields"])) { + if ((isset($xml_options["ignore_fields"]) && !in_array($field, $xml_options["ignore_fields"])) || !isset($xml_options["ignore_fields"])) { if ($value instanceOf Doctrine_Null) { $xml->addChild($field); } else {