JTable/setDBO: Difference between revisions
From Joomla! Documentation
No edit summary |
m preparing for archive only |
||
| (One intermediate revision by the same user not shown) | |||
| Line 2: | Line 2: | ||
Method to set the JDatabase connector object. | Method to set the JDatabase connector object. | ||
===Syntax=== | ===Syntax=== | ||
| Line 44: | Line 42: | ||
</source> | </source> | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=setDBO | category=setDBO | ||
category=JTable | category=JTable | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
Latest revision as of 02:10, 25 March 2017
Description
Method to set the JDatabase connector object.
Syntax
setDBO(&$db)
| Parameter Name | Default Value | Description |
|---|---|---|
| &$db | A connector object to be used by the table object. |
Returns
boolean True on success.
Defined in
libraries/joomla/database/table.php
Importing
jimport( 'joomla.database.table' );
Source Body
public function setDBO(&$db)
{
// Make sure the new database object is a JDatabase.
if (!$db instanceof JDatabase) {
return false;
}
$this->_db = &$db;
return true;
}
Examples
Code Examples