API16:JTableContent/toXML
From Joomla! Documentation
Description
Converts record to XML
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 #__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);
}
Examples
Code Examples