pool[$key])) { return false; } $this->pool[$key] = $db; return true; } /** * Get database. * * @param mixed $key Database key * * @return ConnectionAbstract|null * * @since 1.0.0 */ public function get(string $key = 'core') /* : ?ConnectionAbstract */ { if (!isset($this->pool[$key])) { return null; /* todo: return nullconnection */ } return $this->pool[$key]; } /** * Remove database. * * @param mixed $key Database key * * @return bool * * @since 1.0.0 */ public function remove(string $key) : bool { if (!isset($this->pool[$key])) { return false; } unset($this->pool[$key]); return true; } /** * Create database. * * @param mixed $key Database key * @param array $config Database config data * * @return bool * * @since 1.0.0 */ public function create($key, array $config) : bool { if (isset($this->pool[$key])) { return false; } $this->pool[$key] = ConnectionFactory::create($config); return true; } }