所以我有Model类:
class Model {
protected $database = null;
protected function __construct() {
$this->database = new PDO(DB_TYPE.':dbname='.DB_NAME.';host='.DB_HOST,
DB_USER, DB_PASS);
$this->database-> //Here intellisense works
}
}
我也有扩展它的课程
class Queries extends Model {
...
public function example(){
$this->database-> //Here intellisense doesn't works
}
...
}
为什么intellisense对查询不起作用?
答案 0 :(得分:2)
您需要在父类中添加注释:
class Model {
/**
* @var PDO $database
*/
protected $database = null;
}