API15

API15:JUser/getTable

From Joomla! Documentation

Revision as of 22:17, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Method to get the user table object <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>Edit Descripton<nowiki>]</nowi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Method to get the user table object

[Edit Descripton]

Template:Description:JUser/getTable

Syntax

& 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

object The user table object

Defined in

libraries/joomla/user/user.php

Importing

jimport( 'joomla.user.user' );

Source Body

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
        $table  =& JTable::getInstance( $tabletype['name'], $tabletype['prefix'] );
        return $table;
}

[Edit See Also] Template:SeeAlso:JUser/getTable

Examples

<CodeExamplesForm />