This commit is contained in:
2021-02-25 18:13:30 +08:00
parent f5ce3ab2a7
commit 738afc1cc3
+3 -3
View File
@@ -487,14 +487,14 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
} }
/** /**
* @param null $data * @param array|null $data
* @return bool|$this * @return bool|$this
* @throws Exception * @throws Exception
*/ */
public function save($data = NULL): static|bool public function save(array $data = NULL): static|bool
{ {
if (!is_null($data)) { if (!is_null($data)) {
$this->attributes = $data; $this->_attributes = $data;
} }
if (!$this->validator($this->rules())) { if (!$this->validator($this->rules())) {