php – Object of class Conn could not be converted to string in

The following error is presented to me when designing queries to the database, I attach the source code:

Validations.php:

    prepare ($ sql);
$ query = execute (array ('user' => $ user, 'password' => $ password));

$ result = $ query -> fetch ();

if ($ result! == false) {
    $ _SESSION['usuario'] = $ user;
    header ('Location: views / home.php');
} else {
    header ('Location: index.php');
}
}
?>

Log of the connection:

dbname = "scrum";
    $ this-> host = "localhost";
    $ this-> user = "postgres";
    $ this-> pass = "1234";
    $ this-> port = "5432";

    try {
        $ this-> connection = new PDO ("pgsql: host =". $ this-> host.
                            "; port =". $ this-> port.
                            "; dbname =". $ this-> dbname.
                            "; user =". $ this-> user.
                            "; password =". $ this-> pass);
        } catch (Exception $ e)
        {
            echo "You have the following error:", $ e-> getMessage ();
        }
}



}

?>