public static function createConnection(ConfigurationInterface $configuration)
    {

        // initialize the PDO connection
        $dsn = $configuration->getDatabase()->getDsn();
        $username = $configuration->getDatabase()->getUsername();
        $password = $configuration->getDatabase()->getPassword();
        $connection = new \PDO($dsn, $username, $password);
        $connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);

        // reurn the wrapped PDO connection
        return new PDOConnectionWrapper($connection);
    }
public static function createConnection(ConfigurationInterface $configuration)
    {

        // initialize the PDO connection
        $dsn = $configuration->getDatabase()->getDsn();
        $username = $configuration->getDatabase()->getUsername();
        $password = $configuration->getDatabase()->getPassword();
        $connection = new \PDO($dsn, $username, $password);
        $connection->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);

        // reurn the wrapped PDO connection
        return new PDOConnectionWrapper($connection);
    }
public static function createConnection ( ConfigurationInterface $ configuration ) { // initialize the PDO connection $ dsn = $ configuration -> getDatabase ( ) -> getDsn ( ) ; $ username = $ configuration -> getDatabase ( ) -> getUsername ( ) ; $ password = $ configuration -> getDatabase ( ) -> getPassword ( ) ; $ connection = new \ PDO ( $ dsn , $ username , $ password ) ; $ connection -> setAttribute ( \ PDO :: ATTR_ERRMODE , \ PDO :: ERRMODE_EXCEPTION ) ; // reurn the wrapped PDO connection return new PDOConnectionWrapper ( $ connection ) ; }
Create's and return's the connection to use.

@param \TechDivision\Import\ConfigurationInterface $configuration The configuration with the data to create the connection with

@return \TechDivision\Import\Connection\PDOConnectionWrapper The initialized connection
Create s and return s the connection to use .