Home  >  Article  >  Backend Development  >  复杂代码,请高手指教,该怎么处理

复杂代码,请高手指教,该怎么处理

WBOY
WBOYOriginal
2016-06-13 09:59:11844browse

复杂代码,请高手指教

PHP code
<!--Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->        if ($req->hasParam('keyword')) {            $folder = $this->getUserAccount()->getMaildir()->getFolderById();        } 


请高手帮忙看下,像这句 $folder = $this->getUserAccount()->getMaildir()->getFolderById();,应该怎样去分析,怎样去分层理解,我是这样理解的,$this->getUserAccount()返回的应该是个对象,$this->getUserAccount()->getMaildir()返回的应该也是对象,然后再调用$this->getUserAccount()->getMaildir()这个对象的getFolderById()方法;现在是我一看到这么一长串就蒙了,以前总是面向过程写代码,现在看到这样的一长串,感到无从下手,请高手指教

------解决方案--------------------
有点像ORM,这是什么框架?
------解决方案--------------------
这个肯定是对象了,因为只有对象对有 ->方法
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn