【发布时间】:2011-08-22 20:31:43
【问题描述】:
我试图理解这段代码,但当我到达最后一行时,我没有明白。 :(
我可以请你帮忙看看,return $this 是什么意思?
public function setOptions(array $options) {
$methods = get_class_methods($this);
foreach ($options as $key => $value) {
$method = 'set' . ucfirst($key);
if (in_array($method, $methods)) {
$this->$method($value);
}
}
//???? - return what ?
return $this;
}
更新:
为了更清楚地说明,我删除了我的 cmets。
【问题讨论】:
-
[11072965][1] [1] 的可能副本:stackoverflow.com/questions/11072965/…
-
这意味着很多朋友。
标签: php oop zend-framework return