public function createDoctrineConnection(array $params)
	{
// 		$managed = isset($params['managed']);
		$options = !empty($params['options']) ? (array)$params['options'] : [];
		
		if(array_key_exists('encoding', $params))
		{
			$params['charset'] = $params['encoding'];
			unset($params['encoding']);
		}
		
		unset($params['managed']);
		unset($params['options']);
		
		$params = array_merge([
			'charset' => 'utf8'
		], $params);
		
		if(array_key_exists('username', $params))
		{
			if(!array_key_exists('user', $params))
			{
				$params['user'] = $params['username'];
				unset($params['username']);
			}
		}
		
		if(isset($params['dsn']))
		{
			list($type, $tmp) = explode(':', $params['dsn'], 2);
			unset($params['dsn']);
			
			$cfg = [
				'driver' => 'pdo_' . $type
			];
			
			if($cfg['driver'] == 'pdo_sqlite')
			{
				if($tmp == ':memory:')
				{
					$cfg['memory'] = true;
				}
				else
				{
					$cfg['path'] = $tmp[1];
				}
			}
			else
			{
				foreach(explode(';', $tmp) as $conf)
				{
					$parts = array_map('trim', explode('=', $conf, 2));
					$cfg[$parts[0]] = $parts[1];
				}
			}
			
			$params = array_merge($cfg, $params);
		}
		
		$conn = new Doctrine\Connection(DriverManager::getConnection($params), $options);
		$conn->setEventDispatcher($this->eventDispatcher);
		
		return $conn;
	}
public function createDoctrineConnection(array $params)
	{
// 		$managed = isset($params['managed']);
		$options = !empty($params['options']) ? (array)$params['options'] : [];
		
		if(array_key_exists('encoding', $params))
		{
			$params['charset'] = $params['encoding'];
			unset($params['encoding']);
		}
		
		unset($params['managed']);
		unset($params['options']);
		
		$params = array_merge([
			'charset' => 'utf8'
		], $params);
		
		if(array_key_exists('username', $params))
		{
			if(!array_key_exists('user', $params))
			{
				$params['user'] = $params['username'];
				unset($params['username']);
			}
		}
		
		if(isset($params['dsn']))
		{
			list($type, $tmp) = explode(':', $params['dsn'], 2);
			unset($params['dsn']);
			
			$cfg = [
				'driver' => 'pdo_' . $type
			];
			
			if($cfg['driver'] == 'pdo_sqlite')
			{
				if($tmp == ':memory:')
				{
					$cfg['memory'] = true;
				}
				else
				{
					$cfg['path'] = $tmp[1];
				}
			}
			else
			{
				foreach(explode(';', $tmp) as $conf)
				{
					$parts = array_map('trim', explode('=', $conf, 2));
					$cfg[$parts[0]] = $parts[1];
				}
			}
			
			$params = array_merge($cfg, $params);
		}
		
		$conn = new Doctrine\Connection(DriverManager::getConnection($params), $options);
		$conn->setEventDispatcher($this->eventDispatcher);
		
		return $conn;
	}
public function createDoctrineConnection ( array $ params ) { // 		$managed = isset($params['managed']); $ options = ! empty ( $ params [ 'options' ] ) ? ( array ) $ params [ 'options' ] : [ ] ; if ( array_key_exists ( 'encoding' , $ params ) ) { $ params [ 'charset' ] = $ params [ 'encoding' ] ; unset ( $ params [ 'encoding' ] ) ; } unset ( $ params [ 'managed' ] ) ; unset ( $ params [ 'options' ] ) ; $ params = array_merge ( [ 'charset' => 'utf8' ] , $ params ) ; if ( array_key_exists ( 'username' , $ params ) ) { if ( ! array_key_exists ( 'user' , $ params ) ) { $ params [ 'user' ] = $ params [ 'username' ] ; unset ( $ params [ 'username' ] ) ; } } if ( isset ( $ params [ 'dsn' ] ) ) { list ( $ type , $ tmp ) = explode ( ':' , $ params [ 'dsn' ] , 2 ) ; unset ( $ params [ 'dsn' ] ) ; $ cfg = [ 'driver' => 'pdo_' . $ type ] ; if ( $ cfg [ 'driver' ] == 'pdo_sqlite' ) { if ( $ tmp == ':memory:' ) { $ cfg [ 'memory' ] = true ; } else { $ cfg [ 'path' ] = $ tmp [ 1 ] ; } } else { foreach ( explode ( ';' , $ tmp ) as $ conf ) { $ parts = array_map ( 'trim' , explode ( '=' , $ conf , 2 ) ) ; $ cfg [ $ parts [ 0 ] ] = $ parts [ 1 ] ; } } $ params = array_merge ( $ cfg , $ params ) ; } $ conn = new Doctrine \ Connection ( DriverManager :: getConnection ( $ params ) , $ options ) ; $ conn -> setEventDispatcher ( $ this -> eventDispatcher ) ; return $ conn ; }
Create a connection backed by a Doctrine DBAL connection.

This method will accept a param named "dsn" and extract contained data into the DBAL params array.

@param array<string, mixed> $params
@return \KoolKode\Database\Doctrine\Connection
Create a connection backed by a Doctrine DBAL connection .