public function add($id, QueryBuilder $connection)
    {
        if (isset($this->connections[$id])) {
            throw new InvalidArgumentException('A connection with the ID "'.$id.'" already exists.');
        }

        $this->connections[$id] = $connection;
        $this->default = false;

        return $this;
    }
public function add($id, QueryBuilder $connection)
    {
        if (isset($this->connections[$id])) {
            throw new InvalidArgumentException('A connection with the ID "'.$id.'" already exists.');
        }

        $this->connections[$id] = $connection;
        $this->default = false;

        return $this;
    }
public function add ( $ id , QueryBuilder $ connection ) { if ( isset ( $ this -> connections [ $ id ] ) ) { throw new InvalidArgumentException ( 'A connection with the ID "' . $ id . '" already exists.' ) ; } $ this -> connections [ $ id ] = $ connection ; $ this -> default = false ; return $ this ; }
Adds a connection.

@param string       $id
@param QueryBuilder $connection

@throws InvalidArgumentException if a connection with the given ID already exists

@return $this
Adds a connection .