references:joomla.framework:application:jmodel-getdbogetDBO
Returns a reference to the database connector object used by the model. SyntaxJDatabase &getDBO () ExamplesExample jimport( 'joomla.application.component.model' ); class HelloModelHellos extends JModel { function __construct() { $config = array( 'name' => 'MyModel', 'table_path' => JPATH_COMPONENT.DS.'tables' ); parent::__construct( $config ); } } $model = new HelloModelHellos(); $db =& $model->getDBO(); echo $db->getVersion(); might produce Result 5.0.38-Ubuntu_0ubuntu1-log |


