mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-01 12:42:48 +08:00
Model类增加readonly方法
This commit is contained in:
@@ -1018,6 +1018,21 @@ abstract class Model implements \JsonSerializable, \ArrayAccess
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置只读字段
|
||||
* @access public
|
||||
* @param mixed $field 只读字段
|
||||
* @return $this
|
||||
*/
|
||||
public function readonly($field)
|
||||
{
|
||||
if (is_string($field)) {
|
||||
$field = explode(',', $field);
|
||||
}
|
||||
$this->readonly = $field;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为更新数据
|
||||
* @access public
|
||||
|
||||
Reference in New Issue
Block a user