Actions

API15

JTableContent/toXML

From Joomla! Documentation

< API15:JTableContent
Revision as of 17:16, 22 March 2010 by Doxiki (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

Converts record to XML

[Edit Descripton]

Description:JTableContent/toXML

Syntax

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

Defined in

libraries/joomla/database/table/content.php

Importing

jimport( 'joomla.database.table.content' );

Source Body

function toXML( $mapKeysToText=false )
{
        $db =& JFactory::getDBO();
 
        if ($mapKeysToText) {
                $query = 'SELECT name'
                . ' FROM #__sections'
                . ' WHERE id = '. (int) $this->sectionid
                ;
                $db->setQuery( $query );
                $this->sectionid = $db->loadResult();
 
                $query = 'SELECT name'
                . ' FROM #__categories'
                . ' WHERE id = '. (int) $this->catid
                ;
                $db->setQuery( $query );
                $this->catid = $db->loadResult();
 
                $query = 'SELECT name'
                . ' FROM #__users'
                . ' WHERE id = ' . (int) $this->created_by
                ;
                $db->setQuery( $query );
                $this->created_by = $db->loadResult();
        }
 
        return parent::toXML( $mapKeysToText );
}

[Edit See Also] SeeAlso:JTableContent/toXML

Examples

<CodeExamplesForm />