diff --git a/src/DB/Codeigniter4Adapter.php b/src/DB/Codeigniter4Adapter.php index eb2fe22..7b1fcd9 100644 --- a/src/DB/Codeigniter4Adapter.php +++ b/src/DB/Codeigniter4Adapter.php @@ -17,11 +17,14 @@ class Codeigniter4Adapter extends DBAdapter protected $db; /** - * @var $config + * @var array */ + protected $config; + public function __construct($config = null) { - + $this->config = $config ?? ['DBGroup' => 'default']; + $this->config['DBGroup'] = $this->config['DBGroup'] ?? 'default'; } /** @@ -29,7 +32,7 @@ public function __construct($config = null) */ public function connect() { - $this->db = \Config\Database::connect(); + $this->db = \Config\Database::connect($this->config['DBGroup']); return $this; }