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

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

WBOY
Release: 2016-06-13 09:59:11
Original
891 people have browsed it

复杂代码,请高手指教

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


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

------解决方案--------------------
有点像ORM,这是什么框架?
------解决方案--------------------
这个肯定是对象了,因为只有对象对有 ->方法
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template