public function connect($host, $user, $pass, $name)
    {
        $dsn = "mysql:host={$host};dbname={$name}";

        try {
            $this->pdo = new \PDO($dsn, $user, $pass);
            $this->pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);

            $connected = true;
        } catch (\PDOException $pdo_e) {
            $context = array();

            $context["exception"] = $pdo_e;

            $this->updateLog("error", "MySQL connection failed with the following message: {message}", $context);
            
            $connected = false;
        }

        return $connected;
    }