mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 15:42:48 +08:00
改进Model类的getAttr异常提示
This commit is contained in:
@@ -245,7 +245,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
} elseif (array_key_exists($name, $this->data)) {
|
} elseif (array_key_exists($name, $this->data)) {
|
||||||
return $this->data[$name];
|
return $this->data[$name];
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidArgumentException('property not exists:' . __CLASS__ . '->' . $name);
|
throw new InvalidArgumentException('property not exists:' . $this->class . '->' . $name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -383,7 +383,7 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
|||||||
$this->data[$name] = $value;
|
$this->data[$name] = $value;
|
||||||
return $value;
|
return $value;
|
||||||
} else {
|
} else {
|
||||||
throw new InvalidArgumentException('property not exists:' . __CLASS__ . '->' . $name);
|
throw new InvalidArgumentException('property not exists:' . $this->class . '->' . $name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user