conversion de type dans une methode d'objet
bonjour quand je tape ceci:
Code:
1 2
| public table $table;
$connection->getConnection()->query("SELECT `colonne` FROM $this->table->nom"); |
j'obitent ceci :
Citation:
Fatal error: Uncaught Error: Object of class table could not be converted to string in /web/monscript.php
alors que si je fait ceci , cela fonctionne
Code:
1 2 3
| public table $table;
$convert = $this->table->nom;
$connection->getConnection()->query("SELECT `colonne` FROM $convert"); |
donc pour une raison inconnu , php ne convertit pas la propriété de mon objet (pourtant définit de type string), en string, quand je l'utilise dans une méthode.
Avez vous une explication? merci