From e9ee0f85603989668d1e6b8b97d03b4a1e1aa966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 28 Apr 2021 10:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Database/Base/BaseActiveRecord.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Database/Base/BaseActiveRecord.php b/Database/Base/BaseActiveRecord.php index 4eaf9959..519ac0b6 100644 --- a/Database/Base/BaseActiveRecord.php +++ b/Database/Base/BaseActiveRecord.php @@ -451,7 +451,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess $this->refresh(); - $this->event->dispatch(self::AFTER_SAVE, [$attributes, $param]); + SEvent::trigger(self::AFTER_SAVE, [$attributes, $param]); } catch (\Throwable $exception) { $trance->rollback(); $lastId = $this->addError($exception, 'mysql'); @@ -518,7 +518,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess $this->refresh(); - $this->event->dispatch(self::AFTER_SAVE, [$fields, $param]); + SEvent::trigger(self::AFTER_SAVE, [$fields, $param]); return true; } @@ -538,7 +538,7 @@ abstract class BaseActiveRecord extends Component implements IOrm, ArrayAccess return false; } - if (!$this->event->dispatch(self::BEFORE_SAVE, [$this], $this)) { + if (!SEvent::trigger(self::BEFORE_SAVE, [$this], $this)) { return false; }