This commit is contained in:
2021-04-28 10:49:27 +08:00
parent 759b12d1d7
commit e9ee0f8560
+3 -3
View File
@@ -451,7 +451,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
$this->refresh(); $this->refresh();
$this->event->dispatch(self::AFTER_SAVE, [$attributes, $param]); SEvent::trigger(self::AFTER_SAVE, [$attributes, $param]);
} catch (\Throwable $exception) { } catch (\Throwable $exception) {
$trance->rollback(); $trance->rollback();
$lastId = $this->addError($exception, 'mysql'); $lastId = $this->addError($exception, 'mysql');
@@ -518,7 +518,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
$this->refresh(); $this->refresh();
$this->event->dispatch(self::AFTER_SAVE, [$fields, $param]); SEvent::trigger(self::AFTER_SAVE, [$fields, $param]);
return true; return true;
} }
@@ -538,7 +538,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess
return false; return false;
} }
if (!$this->event->dispatch(self::BEFORE_SAVE, [$this], $this)) { if (!SEvent::trigger(self::BEFORE_SAVE, [$this], $this)) {
return false; return false;
} }