- fixed XML export to export only meaningful attributes of an object (i.e attributes that can actually be loaded back to re-create it)

SVN:code[45]
This commit is contained in:
Denis Flaven
2009-04-14 17:15:08 +00:00
parent 40e6820a4b
commit eb0e025062

View File

@@ -344,10 +344,13 @@ abstract class cmdbAbstractObject extends CMDBObject
while ($oObj = $oSet->Fetch())
{
$oPage->add("<$sClassName id=\"".$oObj->GetKey()."\">\n");
foreach($aList as $sAttCode)
foreach(MetaModel::ListAttributeDefs($sClassName) as $sAttCode=>$oAttDef)
{
$sValue = $oObj->GetAsXML($sAttCode);
$oPage->add("<$sAttCode>$sValue</$sAttCode>\n");
if (($oAttDef->IsWritable()) && ($oAttDef->IsScalar()) && ($sAttCode != 'finalclass') )
{
$sValue = $oObj->GetAsXML($sAttCode);
$oPage->add("<$sAttCode>$sValue</$sAttCode>\n");
}
}
$oPage->add("</$sClassName>\n");
}