Back to DatabaseAwareTrait class

Method getDbo

public \Joomla\Database\DatabaseInterface
getDbo
()
Get the database driver.
Returns
  • \Joomla\Database\DatabaseInterface The database driver.
Since
  • 4.0.0
-
  • \UnexpectedValueException

Method getDbo - Source code

/**
 * Get the database driver.
 *
 * @return  DatabaseInterface  The database driver.
 *
 * @since   4.0.0
 * @throws  \UnexpectedValueException
 */
public function getDbo()
{
    if ($this->_db) {
        return $this->_db;
    }
    throw new \UnexpectedValueException('Database driver not set in ' . __CLASS__);
}