API15

API15:JModel/getTable

From Joomla! Documentation

Revision as of 21:52, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Method to get a table object, load it if necessary. <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JModel/getTable|Edit Descripton...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

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

[Edit Descripton]

Template:Description:JModel/getTable

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

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

Examples

<CodeExamplesForm />