API15

JUser/getTable: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m preparing for archive only
 
Line 64: Line 64:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=getTable
  category=getTable
  category=JUser
  category=JUser
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 01:15, 25 March 2017

Description

Method to get the user table object

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

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;
}

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

Examples

Code Examples