php链式调用,php 链式调用问题,调用到5次之后phpstorm无法提示

1.我定义了一个AR基类,里面代码如下:

abstract class AR extends \PDO {

abstract public function from($tableName = '');

abstract public function where($condition = []);

abstract public function addWhere($condition = []);

abstract public function orderBy($orderBy = []);

abstract public function groupBy($groupBy = []);

abstract public function having($condition = []);

}

2.又写了一个子类DB,集成AR。

class db extends AR {

public function select($field = [])

{

// TODO: Implement select() method.

return $this;

}

public function from($tableName = '')

{

// TODO: Implement from() method.

return $this;

}

public function where($condition = [])

{

// TODO: Implement where() method.

return $this;

}

public function addWhere($condition = [])

{

// TODO: Implement andWhere() method.

return $this;

}

public function groupBy($groupBy = [])

{

// TODO: Implement groupBy() method.

return $this;

}

public function orderBy($orderBy = [])

{

// TODO: Implement orderBy() method.

return $this;

}

public function having($condition = [])

{

// TODO: Implement having() method.

return $this;

}

}

抽象方法的具体实现里,都返回了本身。

3.现在我在控制器文件里实例化db类,发现能正常调用 $this->db->select()->from()->where()->queryAll(); 运行不报错。queryAll里可以进行操作。

bVNd63?w=1420&h=771

现在问题是我在 phpstorm 里面写代码的时候,写前面几个方法,编辑器可以智能提示,但是最后一个queryAll就不提示了,如果把这个链,删掉其中一个,就又可以提示了。感觉就像是最多只能提示到 第 4 个调用。 但是我用yii的时候,链式调用 7 次还是能提示的 。

1460000009313931

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值