JUser/getTable
From Joomla! Documentation
< API16:JUser
The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
Description[edit]
Method to get the user table object
Syntax[edit]
getTable($type=null, $prefix= 'JTable')
Parameter Name | Default Value | Description |
---|---|---|
$type | null | The user table name to be used |
$prefix | The user table prefix to be used |
Returns[edit]
object The user table object
Defined in[edit]
libraries/joomla/user/user.php
Importing[edit]
jimport( 'joomla.user.user' );
Source Body[edit]
function getTable($type = null, $prefix = 'JTable')
{
static $tabletype;
//Set the default tabletype;
if (!isset($tabletype)) {
$tabletype['name'] = 'user';
$tabletype['prefix'] = 'JTable';
}
//Set a custom table type is defined
if (isset($type)) {
$tabletype['name'] = $type;
$tabletype['prefix'] = $prefix;
}
// Create the user table object
return JTable::getInstance($tabletype['name'], $tabletype['prefix']);
}
Examples[edit]
Code Examples[edit]