API16:JTable/getInstance
Contents |
Description
Static method to get an instance of a JTable class if it can be found in the table include paths. To add include paths for searching for JTable classes JTable::addIncludePath().
Description:JTable/getInstance
Syntax
static getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | The type (name) of the class to get an instance of. | |
| $prefix | An optional prefix for the table class name. | |
| $config | array() | An optional array of configuration values for the object. |
Returns
mixed A object if found or boolean false if one could not be found.
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
public static function getInstance($type, $prefix = 'JTable', $config = array()) { // Sanitize and prepare the table class name. $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); // Only try to load the class if it doesn't already exist. if (!class_exists($tableClass)) { // Search for the class file in the JTable include paths. jimport('joomla.filesystem.path'); if ($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { // Import the class file. require_once $path; // If we were unable to load the proper class, raise a warning and return false. if (!class_exists($tableClass)) { JError::raiseWarning(0, 'Table class ' . $tableClass . ' not found in file.'); return false; } } else { // If we were unable to find the class file in the JTable include paths, raise a warning and return false. JError::raiseWarning(0, 'Table ' . $type . ' not supported. File not found.'); return false; } } // If a database object was passed in the configuration array use it, otherwise get the global one from JFactory. if (array_key_exists('dbo', $config)) { $db = &$config['dbo']; } else { $db = & JFactory::getDbo(); } // Instantiate a new table class and return it. return new $tableClass($db); }
[Edit See Also] SeeAlso:JTable/getInstance
Examples
<CodeExamplesForm />
getInstance example
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
getInstance example
$row =& JTable::getInstance('review', 'Table');
Returns a reference to the a Table object, always creating it
[<! removed edit link to red link >]
<! removed transcluded page call, red link never existed >
Syntax
& getInstance($type, $prefix= 'JTable', $config=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
Returns
database A database object
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
function &getInstance( $type, $prefix = 'JTable', $config = array() ) { $false = false; $type = preg_replace('/[^A-Z0-9_\.-]/i', '', $type); $tableClass = $prefix.ucfirst($type); if (!class_exists( $tableClass )) { jimport('joomla.filesystem.path'); if($path = JPath::find(JTable::addIncludePath(), strtolower($type).'.php')) { require_once $path; if (!class_exists( $tableClass )) { JError::raiseWarning( 0, 'Table class ' . $tableClass . ' not found in file.' ); return $false; } } else { JError::raiseWarning( 0, 'Table ' . $type . ' not supported. File not found.' ); return $false; } } //Make sure we are returning a DBO object if (array_key_exists('dbo', $config)) { $db =& $config['dbo']; } else { $db = & JFactory::getDBO(); } $instance = new $tableClass($db); //$instance->setDBO($db); return $instance; }
[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >
Examples
<CodeExamplesForm />
{{Expansion depth limit exceeded}}getInstance example
Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
Returns a reference to the a Table object, always creating it
Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
<! removed transcluded page call, red link never existed >
<span class="error">Expansion depth limit exceeded Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
| Parameter Name | Default Value | Description |
|---|---|---|
| $type | $type The table type to instantiate | |
| $prefix | $prefix A prefix for the table class name. Optional. | |
| $config | array() | $options Configuration array for model. Optional. |
<span class="error">Expansion depth limit exceeded database A database object
<span class="error">Expansion depth limit exceeded libraries/joomla/database/table.php <span class="error">Expansion depth limit exceeded Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
<span class="error">Expansion depth limit exceeded Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
Invalid tag extension name: <span class="error">expansion depth limit exceeded</span> <! removed transcluded page call, red link never existed >
<span class="error">Expansion depth limit exceeded <CodeExamplesForm /> Invalid tag extension name: <span class="error">expansion depth limit exceeded</span>
