改名
This commit is contained in:
@@ -538,17 +538,14 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
|||||||
if (!is_null($data)) {
|
if (!is_null($data)) {
|
||||||
$this->_attributes = merge($this->_attributes, $data);
|
$this->_attributes = merge($this->_attributes, $data);
|
||||||
}
|
}
|
||||||
if (!$this->validator($this->rules())) {
|
if (!$this->validator($this->rules()) || !$this->beforeSave($this)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if ($this->beforeSave($this)) {
|
[$change, $condition, $fields] = $this->separation();
|
||||||
[$change, $condition, $fields] = $this->filtration_and_separation();
|
if (!$this->isNewExample) {
|
||||||
if (!$this->isNewExample) {
|
return $this->updateInternal($fields, $condition, $change);
|
||||||
return $this->updateInternal($fields, $condition, $change);
|
|
||||||
}
|
|
||||||
return $this->insert($change, $fields);
|
|
||||||
}
|
}
|
||||||
return false;
|
return $this->insert($change, $fields);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -618,7 +615,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
|
|||||||
* @return array
|
* @return array
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
private function filtration_and_separation(): array
|
private function separation(): array
|
||||||
{
|
{
|
||||||
$_tmp = [];
|
$_tmp = [];
|
||||||
$condition = [];
|
$condition = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user