Actions

API15

JModel/getTable

From Joomla! Documentation

< API15:JModel
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Method to get a table object, load it if necessary.

[<! removed edit link to red link >]

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

Syntax

& getTable($name='', $prefix='Table', $options=array())
Parameter Name Default Value Description
$name The table name. Optional.
$prefix 'Table' The class prefix. Optional.
$options array() Configuration array for model. Optional.

Returns

object The table

Defined in

libraries/joomla/application/component/model.php

Importing

jimport( 'joomla.application.component.model' );

Source Body

function &getTable($name='', $prefix='Table', $options = array())
{
        if (empty($name)) {
                $name = $this->getName();
        }
 
        if($table = &$this->_createTable( $name, $prefix, $options ))  {
                return $table;
        }
 
        JError::raiseError( 0, 'Table ' . $name . ' not supported. File not found.' );
        $null = null;
return $null;
}

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

Examples

<CodeExamplesForm />