Commit a164c6a2 authored by meus's avatar meus

fixed some in the export xml functions to correctly show records if no...

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
parent 2acd3062
......@@ -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 = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><" . $collectionName . "></" . $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 = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?><" . $recordname . "></" . $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 {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment