改进Query类的getOptions方法 当name参数不存在的时候返回null

This commit is contained in:
thinkphp
2016-09-27 17:26:36 +08:00
parent 7a27dafae4
commit afa348bc46

View File

@@ -1487,7 +1487,11 @@ class Query
*/
public function getOptions($name = '')
{
return isset($this->options[$name]) ? $this->options[$name] : $this->options;
if ('' === $name) {
return $this->options;
} else {
return isset($this->options[$name]) ? $this->options[$name] : null;
}
}
/**