Actions

API16

JModel/getTable

< API16:JModel

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

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



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

public 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.');
 
        return null;
}



Examples

Code Examples


Advertisement