Netbeans intellisense不适合儿童班

时间:2014-03-15 14:18:08

标签: php netbeans autocomplete intellisense

所以我有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对查询不起作用?

1 个答案:

答案 0 :(得分:2)

您需要在父类中添加注释:

class Model {
    /**
     * @var PDO $database
     */
    protected $database = null;
}