API16

JTable/setDBO: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
No edit summary
m clean up
Line 2: Line 2:
Method to set the JDatabase connector object.
Method to set the JDatabase connector object.


<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>[[Description:JTable/setDBO|Edit Descripton]]<nowiki>]</nowiki>
</span>


{{Description:JTable/setDBO}}
 
{{subst:Description:JTable/setDBO}}


===Syntax===
===Syntax===
Line 44: Line 42:
</source>
</source>


<span class="editsection" style="font-size:76%;">
 
<nowiki>[</nowiki>[[SeeAlso:JTable/setDBO|Edit See Also]]<nowiki>]</nowiki>
{{subst:SeeAlso:JTable/setDBO}}
</span>
{{SeeAlso:JTable/setDBO}}


===Examples===
===Examples===

Revision as of 14:29, 24 March 2017

Description

Method to set the JDatabase connector object.


{{subst:Description:JTable/setDBO}}

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


{{subst:SeeAlso:JTable/setDBO}}

Examples

<CodeExamplesForm />