db = isset($db) ? $db : $this->loadDb(); } /** * Get the database driver. * * @return JDatabaseDriver The database driver. * * @since 12.1 */ public function getDb() { return $this->db; } /** * Set the database driver. * * @param JDatabaseDriver $db The database driver. * * @return void * * @since 12.1 */ public function setDb(JDatabaseDriver $db) { $this->db = $db; } /** * Load the database driver. * * @return JDatabaseDriver The database driver. * * @since 12.1 */ protected function loadDb() { return JFactory::getDbo(); } }