API16:JModel/getTable
From Joomla! Documentation
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.
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] SeeAlso:JModel/getTable
Examples
<CodeExamplesForm />
