Doctrine\DBAL\Migrations\Tools\Console\Command\AbstractCommand::getConnection PHP Method

getConnection() private method

private getConnection ( Symfony\Component\Console\Input\InputInterface $input ) : Doctrine\DBAL\Connection
$input Symfony\Component\Console\Input\InputInterface
return Doctrine\DBAL\Connection
    private function getConnection(InputInterface $input)
    {
        if ($this->connection) {
            return $this->connection;
        }
        $chainLoader = new ConnectionConfigurationChainLoader([new ArrayConnectionConfigurationLoader($input->getOption('db-configuration')), new ArrayConnectionConfigurationLoader('migrations-db.php'), new ConnectionHelperLoader($this->getHelperSet(), 'connection'), new ConnectionConfigurationLoader($this->configuration)]);
        $connection = $chainLoader->chosen();
        if ($connection) {
            return $this->connection = $connection;
        }
        throw new \InvalidArgumentException('You have to specify a --db-configuration file or pass a Database Connection as a dependency to the Migrations.');
    }