@param string|null $name

@throws Exception\DomainException If requested import adapter not found in those provided during construction
@return DatabaseImportExportAdapterInterface
196262
public function getAdapter(string $name): DatabaseImportExportAdapterInterface
    {
        if (!array_key_exists($name, $this->adapters)) {
            throw new Exception\DomainException("Database import/export adapter not found by name \"$name\".");
        }

        return $this->adapters[$name];
    }
959954
public function getEnvironmentConfiguration(string $name): EnvironmentConfiguration
    {
        if (array_key_exists($name, $this->environmentConfigurations)) {
            return $this->environmentConfigurations[$name];
        }
        throw new DomainException('There is no environment configuration with name' . $name);
    }
771067
public function getDomain($name)
    {
        if (isset($this->domainMap[$name])) {
            return $this->domainMap[$name];
        }

        return null;
    }
521485
public function instantiateMigration($name)
    {
        if (!$this->isMigrationExists($name)) {
            throw new Exception("Can't find file for migration with name {$name}");
        }

        if (!class_exists($name, false)) {
            require_once "{$this->folder}/{$name}.php";
            if (!class_exists($name, false)) {
                throw new Exception(
                    "File {$this->folder}/{$name}.php has no {$name} class"
                );
            }
        }

        return new $name;
    }
826563
public function getConnection($name)
    {
        if (!$this->connectionSettings->has($name)) {
            throw new BadArgumentException('Connection with name ":name" not defined in configuration file ":file"', [
                'name' => $name, 'file' => ServiceLocator::instance()->getConfiguration()->getIdentity(),
            ]);
        }
        
        $this->connect($name);
        
        return static::$connections[$name];
    }
769800
public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()
            ->getProductAlternativeDataImport()
            ->import($dataImporterConfigurationTransfer);
    }
1038462
public function getAdapter(string $name): ShellAdapterInterface
    {
        if (!array_key_exists($name, $this->shellAdapters)) {
            throw new Exception\DomainException("Shell adapter \"$name\" not found.");
        }

        return clone $this->shellAdapters[$name];
    }
924834
public function acquire( $name = 'db' )
	{
		try
		{
			$adapter = $this->_config->get( 'resource/' . $name . '/adapter', 'mysql' );

			if( !isset( $this->_connections[$name] ) || empty( $this->_connections[$name] ) )
			{
				if( !isset( $this->_count[$name] ) ) {
					$this->_count[$name] = 0;
				}

				$limit = $this->_config->get( 'resource/' . $name . '/limit', -1 );

				if( $limit >= 0 && $this->_count[$name] >= $limit ) {
					throw new MW_DB_Exception( sprintf( 'Maximum number of connections (%1$d) exceeded', $limit ) );
				}

				$this->_connections[$name] = array( $this->_createConnection( $name, $adapter ) );
				$this->_count[$name]++;
			}

			switch( $adapter )
			{
				case 'sqlite':
				case 'sqlite3':
					// SQLite uses page locking which prevents a second connection from
					// reading from tables which are already in use. Fortunately, it is
					// possible withing the same connection to do the update.
					return $this->_connections[$name][0];
			}

			return array_pop( $this->_connections[$name] );

		}
		catch( PDOException $e ) {
			throw new MW_DB_Exception( $e->getMessage(), $e->getCode(), $e->errorInfo );
		}
	}
473539
protected function createComponent($name)
    {
        $result = null;

        $config = $this->getComponentConfig($name);

        if ($config !== null && isset($config['class'])) {
            $result = new $config['class'];
            if (!($result instanceof \pwf\basic\interfaces\Component)) {
                throw new \Exception('Component must implement \'Component\' interface',
                500);
            }
            $result->loadConfiguration($config);
        }

        return $result;
    }
345334
protected function getConfig($name)
	{
		$name = $name ?: $this->getDefaultConnection();

		// To get the database connection configuration, we will just pull each of the
		// connection configurations and get the configurations for the given name.
		// If the configuration doesn't exist, we'll throw an exception and bail.
		$connections = $this->app['config']['database.connections'];

		if (is_null($config = array_get($connections, $name)))
		{
			throw new InvalidArgumentException("Database [$name] not configured.");
		}

		return $config;
	}
74504
public function getDatabase($name = null)
    {
        if (empty($name)) {
            $name = $this->getCurrentDatabaseName();
        }

        if (!isset($this->databasePool[$name])) {
            // init db
            $database = new Database($this, $name);
            if (isset($this->mapping[$name])) {
                $database->map($this->mapping[$name]);
            }

            // configure db
            $this->databasePool[$name] = $database;
        }
        
        return $this->databasePool[$name];
    }
480247
private function detectByName($name)
    {
        $detectedAdapter = null;

        foreach ($this->adapters as $adapter) {
            if ($adapter->getName() === $name) {
                $detectedAdapter = $adapter;
                break;
            }
        }

        return $detectedAdapter;
    }
32979
public function requireColumn($name)
    {
        if ($name != strtolower($name)) {
            throw new \DomainException('Column name must be lowercase: ' . $name);
        }

        if (!isset($this->_columns[$name])) {
            throw new \RuntimeException('Undefined column: ' . $this->_name . '.' . $name);
        }
    }
1183810
private static function getConnectionConfiguration($name)
    {
        $databaseConfig = Configuration::get('database.connections');
        if (isset($databaseConfig[$name])) {
            $databaseConfig = $databaseConfig[$name];
        } else {
            $databaseConfig = null;
        }

        if ($databaseConfig === null) {
            throw new ConfigurationException("Database configuration for connection '" . $name . "' doesn't exists!");
        }

        if (! isset($databaseConfig['driver'])) {
            throw new ConfigurationException("Database configuration for connection '" . $name . "' is invalid!");
        }

        return $databaseConfig;
    }
1190841
public function import(?DataImporterConfigurationTransfer $dataImporterConfigurationTransfer = null): DataImporterReportTransfer
    {
        return $this->getFactory()->createMerchantRelationshipDataImport()->import($dataImporterConfigurationTransfer);
    }
374303
public function getHelper($name)
    {
        if (empty($this->helpers[$name])) {
            $class = $this->findHelper($name);

            if ($class === false) {
                throw new \DomainException(sprintf('Helper: %s not found.', $name));
            }

            $this->helpers[$name] = new $class($this);
        }

        return $this->helpers[$name];
    }
59924
public function get(string $name = null)
    {
        return $this->requestParser->parseInto(
                $this->injector->getInstance(
                        $this->userInputClass,
                        'stubbles.console.input.instance'
                ),
                $name
        );
    }