API15

API15:JTable/toXML

From Joomla! Documentation

Revision as of 22:16, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Export item list to xml <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki> </span> ...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Export item list to xml

[Edit Descripton]

Template:Description:JTable/toXML

Syntax

toXML($mapKeysToText=false)
Parameter Name Default Value Description
$mapKeysToText false Map foreign keys to text values

Defined in

libraries/joomla/database/table.php

Importing

jimport( 'joomla.database.table' );

Source Body

function toXML( $mapKeysToText=false )
{
        $xml = '<record table="' . $this->_tbl . '"';

        if ($mapKeysToText)
        {
                $xml .= ' mapkeystotext="true"';
        }
        $xml .= '>';
        foreach (get_object_vars( $this ) as $k => $v)
        {
                if (is_array($v) or is_object($v) or $v === NULL)
                {
                        continue;
                }
                if ($k[0] == '_')
                { // internal field
                        continue;
                }
                $xml .= '<' . $k . '><![CDATA[' . $v . ']]></' . $k . '>';
        }
        $xml .= '</record>';

        return $xml;
}

[Edit See Also] Template:SeeAlso:JTable/toXML

Examples

<CodeExamplesForm />