连锁方法,有可能打破一个链? [英] chain methods, is it possible to break a chain?

查看:90
本文介绍了连锁方法,有可能打破一个链?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的先生,


说,你知道是否有可能打破 php中的方法链?


例如

Dear sir,

say, do you know if it is possible to "break" a method chain in php?

e.g.

展开 | 选择 | Wrap | 行号

推荐答案

您可以抛出异常而不是返回false,然后在try / catch块中运行你的obj调用。
You could throw an exception instead of returning false, and then run your obj calls in a try/catch block.


再次嗨!


感谢您的回复,以及您对此方法的提示问题,


我会调查一下:D
Hi again!

Thanks for your reply, and your tips for an approach to this problem,

I''ll look into this :D


@ManWithNoName


没有problamo!让我们知道你是怎么过的。


Mark。
@ManWithNoName
No problamo! Let us know how you get on.

Mark.


这篇关于连锁方法,有可能打破一个链?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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