改进Model类的__isset方法 支持获取器判断

This commit is contained in:
thinkphp
2016-05-30 15:19:52 +08:00
parent 42fe2d3025
commit 031de8c99d

View File

@@ -1151,7 +1151,13 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
*/
public function __isset($name)
{
return isset($this->data[$name]);
if (isset($this->data[$name])) {
return true;
} elseif ($this->__get($name)) {
return true;
} else {
return false;
}
}
/**