public function addDataSource($name, AbstractDataSource $dataSource)
    {
        if ($this->hasDataSource($name)) {
            throw new \RuntimeException(sprintf('A previous data source exists with the same name: "%s".', $name));
        }

        $this->dataSources[$name] = $dataSource;
    }
public function addDataSource($name, AbstractDataSource $dataSource)
    {
        if ($this->hasDataSource($name)) {
            throw new \RuntimeException(sprintf('A previous data source exists with the same name: "%s".', $name));
        }

        $this->dataSources[$name] = $dataSource;
    }
public function addDataSource ( $ name , AbstractDataSource $ dataSource ) { if ( $ this -> hasDataSource ( $ name ) ) { throw new \ RuntimeException ( sprintf ( 'A previous data source exists with the same name: "%s".' , $ name ) ) ; } $ this -> dataSources [ $ name ] = $ dataSource ; }
Adds a new data source.

@param string             $name       The name of the data source
@param AbstractDataSource $dataSource

@throws \RuntimeException If a previous data sources exists with the same name
Adds a new data source .