PhpStorm 通过魔术方法访问的字段
2022-08-30 08:48:11
我已经在我的CodeIgniter库文件夹中点燃了数据表库。
库中的一些代码
class Datatables
{
/**
* Global container variables for chained argument results
*
*/
protected $ci;
protected $table;
protected $distinct;
protected $group_by;
protected $select = array();
protected $joins = array();
protected $columns = array();
protected $where = array();
protected $filter = array();
protected $add_columns = array();
protected $edit_columns = array();
protected $unset_columns = array();
/**
* Copies an instance of CI
*/
public function __construct()
{
$this->ci =& get_instance();
}
然后我在模型中调用了库
class Common_Model extends MY_Model{
function __construct(){
parent::__construct();
$this->load->library('Datatables.php');
}
然后我尝试调用库函数
function select_fields_joined_DT($data, $PTable, $joins = '', $where = '', $addColumn = '',$unsetColumn='')
{
/**
*
*/
$this->datatables->select($data);
if ($unsetColumn != '') {
unset_column($unsetColumn);
}
$this->datatables->from($PTable);
if ($joins != '') {
foreach ($joins as $k => $v) {
//$this->datatables->join($v['table'], $v['condition'], $v['type']);
}
}
if ($addColumn != '') {
$this->datatables->add_column("Actions", $addColumn);
}
$result = $this->datatables->generate();
return $result;
}
一切正常,除了phpstorm向我显示此错误:
Field Accessed via magic method
我试图用文档注释删除此错误,但无法弄清楚我该怎么做。任何帮助将不胜感激。