Actions

API15

JTableContent/toXML

From Joomla! Documentation

< API15:JTableContent
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

[<! 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/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 );
}

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

Examples

<CodeExamplesForm />