1
0
mirror of synced 2025-01-29 19:41:45 +03:00

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

This commit is contained in:
meus 2007-06-27 08:14:05 +00:00
parent 2acd30624d
commit a164c6a2cd

View File

@ -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 {