通过魔术方法访问PhpStorm字段 [英] PhpStorm Field accessed via magic method

查看:104
本文介绍了通过魔术方法访问PhpStorm字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在CodeIgniter库文件夹中点燃了数据表库.

I have ignited datatables Library in my CodeIgniter library folder.

库中的某些代码

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向我显示此错误:

and everything works fine, except that the phpstorm shows me this error:

Field Accessed via magic method

我试图用文档注释消除此错误,但无法弄清楚该怎么做. 任何帮助将不胜感激.

I tried to remove this error with document comments but can't figure out how can I do that.. any help will be appreciated.

推荐答案

如果要删除此文件而没有文档注释,则可以取消选中通知有关通过魔术方法访问字段的通知,该通知位于

If you want to remove this without document comments you can uncheck Notify about access to a field via magic method which is found in

项目设置> 检查> PHP > 未定义> 未定义字段

这篇关于通过魔术方法访问PhpStorm字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆