Salve,
sto progettando un'applicazione web che dà all'amministratore la possibilità di cercare un utente nel database e se è presente, visualizzarne tutti i suoi dati.
La funzione existUsername restituisce l'utente cercato dall'inserimento dell'Username. In gestionePOST voglio poter recuperare il return di existUsername e stampaarlo, come posso fare?in questo modo ovviamente mi dà errore (Catchable fatal error: Object of class EUtente could not be converted to string in C:\xampp\htdocs\fedeb\GestionePOST.php on line 76)

gestionePOST.class.php

if(isset($_POST['formCercaUtente']))
{
require_once('Control\CUtente.class.php'); $utente=Singleton::getInstance("FUtente"); $esiste=$utente->existUsername($_POST['username']);
if(!$esiste)
echo ("L'utente cercato non è presente nel database");
else
echo $esiste.getNome();
}

FUtente.class.php

public function existUsername($user)
{
$mysqli=new FControl();
$sql= " SELECT *
FROM utente
WHERE username='{$user}' ;";
if($result=$mysqli->query($sql)){
if(($result->num_rows)==0){
$mysqli->close();
return false;
}
else{

$result=$result->fetch_assoc();
return new EUtente(
$result['CODICEUTENTE'],
$result['USERNAME'],
$result['PASSWORD'],
$result['RUOLO']);

}
}
else{
print("Ricerca username fallita:".$mysqli->error);
$mysqli->close();
exit();
}
}