public function getDataSource($sourceId)
{
if ($sourceId === 'default') {
// If there is a node named 'default', we should use it, otherwise
// we get the node name from default attribute.
$sourceId = $this->getDefaultDataSourceId();
}
if (isset($this->config['data_source']['nodes'][$sourceId])) {
return $this->config['data_source']['nodes'][$sourceId];
}
throw new Exception("data source {$sourceId} is not defined.");
}