private static function setConnectionCollation(Connection $connection, array $options = array())
    {
        if (isset($options['collation'])) {
            try {
                if ('pdo_mysql' === $connection->getDriver()->getName()) {
                    $connection->executeQuery('SET SESSION collation_connection = "'.addslashes($options['collation']).'";');
                }
            } catch (\Exception $e) {
                throw new InvalidArgumentException(
                    sprintf('Invalid database collation `%s`', $options['collation']),
                    InvalidArgumentException::INVALID_ARGUMENT,
                    $e
                );
            }
        }
    }
private static function setConnectionCollation(Connection $connection, array $options = array())
    {
        if (isset($options['collation'])) {
            try {
                if ('pdo_mysql' === $connection->getDriver()->getName()) {
                    $connection->executeQuery('SET SESSION collation_connection = "'.addslashes($options['collation']).'";');
                }
            } catch (\Exception $e) {
                throw new InvalidArgumentException(
                    sprintf('Invalid database collation `%s`', $options['collation']),
                    InvalidArgumentException::INVALID_ARGUMENT,
                    $e
                );
            }
        }
    }
private static function setConnectionCollation ( Connection $ connection , array $ options = array ( ) ) { if ( isset ( $ options [ 'collation' ] ) ) { try { if ( 'pdo_mysql' === $ connection -> getDriver ( ) -> getName ( ) ) { $ connection -> executeQuery ( 'SET SESSION collation_connection = "' . addslashes ( $ options [ 'collation' ] ) . '";' ) ; } } catch ( \ Exception $ e ) { throw new InvalidArgumentException ( sprintf ( 'Invalid database collation `%s`' , $ options [ 'collation' ] ) , InvalidArgumentException :: INVALID_ARGUMENT , $ e ) ; } } }
Sets the collation for the provided connection.

@param  Connection $connection
@param  array      $options
@throws InvalidArgumentException Occurs if collation is invalid
Sets the collation for the provided connection .