Actions

API15

JTable/toXML

From Joomla! Documentation

< API15:JTable
Revision as of 13:52, 12 May 2013 by JoomlaWikiBot (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Export item list to xml

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

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;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

<CodeExamplesForm />