public static function get()
    {
        if (SettingsServer::isTrackerApiRequest()) {
            return Tracker::getDatabase();
        }

        if (!self::hasDatabaseObject()) {
            self::createDatabaseObject();
        }

        return self::$connection;
    }
public static function get()
    {
        if (SettingsServer::isTrackerApiRequest()) {
            return Tracker::getDatabase();
        }

        if (!self::hasDatabaseObject()) {
            self::createDatabaseObject();
        }

        return self::$connection;
    }
public static function get ( ) { if ( SettingsServer :: isTrackerApiRequest ( ) ) { return Tracker :: getDatabase ( ) ; } if ( ! self :: hasDatabaseObject ( ) ) { self :: createDatabaseObject ( ) ; } return self :: $ connection ; }
Returns the database connection and creates it if it hasn't been already.

@return \Piwik\Tracker\Db|\Piwik\Db\AdapterInterface|\Piwik\Db
Returns the database connection and creates it if it hasn t been already .