diff --git a/lib/Doctrine.php b/lib/Doctrine.php index 4f51a5c11..3718e6d06 100644 --- a/lib/Doctrine.php +++ b/lib/Doctrine.php @@ -546,4 +546,3 @@ final class Doctrine return true; } } -?> diff --git a/lib/Doctrine/Lib.php b/lib/Doctrine/Lib.php index b89c653bf..2ea7147f0 100644 --- a/lib/Doctrine/Lib.php +++ b/lib/Doctrine/Lib.php @@ -86,16 +86,16 @@ class Doctrine_Lib public static function getCollectionAsXml(Doctrine_Collection $collection, SimpleXMLElement $incomming_xml = null){ $collectionName = Doctrine_Lib::plurelize($collection->getTable()->tableName); - if ( $collection->count != 0) { - $record = $collection[0]; - $xml_options = $record->option("xml"); - if ( isset($xml_options["collection_name"])) { - $collectionName = $xml_options["collection_name"]; - } - } + if ( $collection->count != 0) { + $record = $collection[0]; + $xml_options = $record->option("xml"); + if ( isset($xml_options["collection_name"])) { + $collectionName = $xml_options["collection_name"]; + } + } if ( ! isset($incomming_xml)) { - $new_xml_string = "<" . $collectionName . ">"; + $new_xml_string = "<" . $collectionName . ">"; $xml = new SimpleXMLElement($new_xml_string); } else { $xml = $incomming_xml->addChild($collectionName); @@ -129,18 +129,18 @@ class Doctrine_Lib { $recordname = $record->getTable()->tableName; if ( !isset($incomming_xml)) { - $new_xml_string = "<" . $recordname . ">"; + $new_xml_string = "<" . $recordname . ">"; $xml = new SimpleXMLElement($new_xml_string); }else{ $xml = $incomming_xml->addChild($recordname); } - foreach($record->obtainIdentifier() as $pk_field => $pk_value){ - $xml->addChild($pk_field,$pk_value); - } + foreach($record->obtainIdentifier() as $pk_field => $pk_value){ + $xml->addChild($pk_field,$pk_value); + } $xml_options = $record->option("xml"); - if ( isset($xml_options["record_name"])) { - $recordname = $xml_options["record_name"]; - } + if ( isset($xml_options["record_name"])) { + $recordname = $xml_options["record_name"]; + } foreach ($record->getData() as $field => $value) { if ((isset($xml_options["ignore_fields"]) && !in_array($field, $xml_options["ignore_fields"])) || !isset($xml_options["ignore_fields"])) { if ($value instanceOf Doctrine_Null) {