protected function getConnectionInstance($datasource)
    {
        $buildConnection = $this->getConnection($datasource);

        $dsn = str_replace("@DB@", $datasource, $buildConnection['dsn']);

        // Set user + password to null if they are empty strings or missing
        $username = isset($buildConnection['user']) && $buildConnection['user'] ? $buildConnection['user'] : null;
        $password = isset($buildConnection['password']) && $buildConnection['password'] ? $buildConnection['password'] : null;

        $con = ConnectionFactory::create(['dsn' => $dsn, 'user' => $username, 'password' => $password], AdapterFactory::create($buildConnection['adapter']));

        return $con;
    }
protected function getConnectionInstance($datasource)
    {
        $buildConnection = $this->getConnection($datasource);

        $dsn = str_replace("@DB@", $datasource, $buildConnection['dsn']);

        // Set user + password to null if they are empty strings or missing
        $username = isset($buildConnection['user']) && $buildConnection['user'] ? $buildConnection['user'] : null;
        $password = isset($buildConnection['password']) && $buildConnection['password'] ? $buildConnection['password'] : null;

        $con = ConnectionFactory::create(['dsn' => $dsn, 'user' => $username, 'password' => $password], AdapterFactory::create($buildConnection['adapter']));

        return $con;
    }
protected function getConnectionInstance ( $ datasource ) { $ buildConnection = $ this -> getConnection ( $ datasource ) ; $ dsn = str_replace ( "@DB@" , $ datasource , $ buildConnection [ 'dsn' ] ) ; // Set user + password to null if they are empty strings or missing $ username = isset ( $ buildConnection [ 'user' ] ) && $ buildConnection [ 'user' ] ? $ buildConnection [ 'user' ] : null ; $ password = isset ( $ buildConnection [ 'password' ] ) && $ buildConnection [ 'password' ] ? $ buildConnection [ 'password' ] : null ; $ con = ConnectionFactory :: create ( [ 'dsn' => $ dsn , 'user' => $ username , 'password' => $ password ] , AdapterFactory :: create ( $ buildConnection [ 'adapter' ] ) ) ; return $ con ; }
Returns a ConnectionInterface instance for a given datasource.

@param  string              $datasource
@return ConnectionInterface
Returns a ConnectionInterface instance for a given datasource .