php – object of class Conn could not be converted to string

When designing queries against the database, the following error appears. I add the source code:

Validations.php:

    prepare ($ sql);
$ query = execute (Array (& # 39; user & # 39; => $ user, & # 39; password & # 39; => $ password));

$ result = $ query -> fetch ();

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

Protocol of connection:

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

try it
$ 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 ();
}
}



}

?>