Improve Code: Database : add __toString

This commit is contained in:
sparkyx 2025-05-19 23:01:31 +02:00
parent da1a6dbc39
commit 001677eb72
2 changed files with 39 additions and 7 deletions

View file

@ -69,9 +69,18 @@ class Database extends DatabaseCore
$this->exec_sql('set search_path to public,comptaproc,pg_catalog;');
}
$this->exec_sql('set DateStyle to ISO, MDY;');
$this->ret=true;
$this->is_open=true;
}
function __toString(): string {
return "DatabaseCore[db=" . var_export($this->db,true)
. ", ret=" .var_export( $this->ret,true)
. ", is_open=" . $this->is_open
. ", sql=" . $this->sql
. ", array=" . var_export($this->array,true)
. ",dbname = ".$this->get_dbname()
. "]";
}
/***
* \brief Save a "piece justificative" , the name must be pj
*