Answer the question
In order to leave comments, you need to log in
PhpStorm, how to determine my own property value?
Hello.
Faced with the fact that PhpStorm does not understand the $this->db->database declaration in the request.
There are 2 databases in the project, when a query needs to address both at once, I get a bunch of errors from phpStorm.
For example
//$this->db2->database string "database2"
$this->db->query("SELECT table1.id, table2.name FROM table1 LEFT JOIN ".$this->db2->database.".users table2 ON table1.id = table2.id");
Answer the question
In order to leave comments, you need to log in
I think that there is some error in the code and the storm swears correctly (the configs or the class for the second database are incorrectly configured).
The easiest way is to save $this->db2->database into a variable before the request and write phpdoc over it with a description of what it returns, then substitute $databaseName2 into the request.
/**
* @var string $databaseName2
*/
$databaseName2 = $this->db2->database;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question