API16

JTable/setDBO: Difference between revisions

From Joomla! Documentation

Doxiki (talk | contribs)
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.


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


{{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>
 
</span>
{{SeeAlso:JTable/setDBO}}


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=setDBO
  category=setDBO
  category=JTable
  category=JTable
  category=CodeExample
  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