mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +08:00
改进Model类的__isset方法
This commit is contained in:
@@ -1294,13 +1294,18 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
*/
|
*/
|
||||||
public function __isset($name)
|
public function __isset($name)
|
||||||
{
|
{
|
||||||
if (array_key_exists($name, $this->data)) {
|
try {
|
||||||
return true;
|
if (array_key_exists($name, $this->data)) {
|
||||||
} elseif ($this->getAttr($name)) {
|
return true;
|
||||||
return true;
|
} elseif ($this->getAttr($name)) {
|
||||||
} else {
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} catch (InvalidArgumentException $e) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user