本文整理汇总了PHP中JTable::toXML方法的典型用法代码示例。如果您正苦于以下问题:PHP JTable::toXML方法的具体用法?PHP JTable::toXML怎么用?PHP JTable::toXML使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JTable
的用法示例。
在下文中一共展示了JTable::toXML方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toXML
/**
* Converts record to XML
*
* @param boolean $mapKeysToText Map foreign keys to text values
* @return string Record in XML format
*/
public function toXML($mapKeysToText = false)
{
$db = JFactory::getDbo();
if ($mapKeysToText) {
$query = 'SELECT name' . ' FROM #__users' . ' WHERE id = ' . (int) $this->user_id;
$db->setQuery($query);
$this->user_name = $db->loadResult();
}
return parent::toXML($mapKeysToText);
}
示例2: toXML
/**
* Converts record to XML
*
* @param boolean $mapKeysToText Map foreign keys to text values
*
* @return string Record in XML format
*
* @since 11.1
* @deprecated 12.1
* @codeCoverageIgnore
*/
public function toXML($mapKeysToText = false)
{
// Deprecation warning.
JLog::add('JTableContent::toXML() is deprecated.', JLog::WARNING, 'deprecated');
if ($mapKeysToText) {
// Get the JDatabaseQuery object
$query = $this->_db->getQuery(true);
$query->select($this->_db->quoteName('name'));
$query->from($this->_db->quoteName('#__categories'));
$query->where($this->_db->quoteName('id') . ' = ' . (int) $this->catid);
$this->_db->setQuery($query);
$this->catid = $this->_db->loadResult();
$query->clear();
$query->select($this->_db->quoteName('name'));
$query->from($this->_db->quoteName('#__users'));
$query->where($this->_db->quoteName('id') . ' = ' . (int) $this->created_by);
$this->_db->setQuery($query);
$this->created_by = $this->_db->loadResult();
}
return parent::toXML($mapKeysToText);
}
示例3: toXML
/**
* Converts record to XML
* @param boolean Map foreign keys to text values
*/
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);
}