From 1f043c56bd2bc30680e33f82525404043d5fda91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Mon, 14 Sep 2020 02:42:10 +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/Orm/Condition.php | 2 +- System/Abstracts/Listener.php | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Database/Orm/Condition.php b/Database/Orm/Condition.php index 58a0cb97..d9dacb4b 100644 --- a/Database/Orm/Condition.php +++ b/Database/Orm/Condition.php @@ -193,7 +193,7 @@ trait Condition * @param bool $isSearch * @return int|string */ - public function valueEncode($value, $isSearch = false) + public function valueEncode($value, $isSearch = false) { if ($isSearch) { return $value; diff --git a/System/Abstracts/Listener.php b/System/Abstracts/Listener.php index 70ea655b..46d4fa49 100644 --- a/System/Abstracts/Listener.php +++ b/System/Abstracts/Listener.php @@ -14,4 +14,18 @@ abstract class Listener extends Component implements IListener protected $trigger = ''; + + /** + * @return string + * @throws \Exception + */ + public function getName() + { + if (empty($this->trigger)) { + throw new \Exception('Listener name con\'t empty.'); + } + return $this->trigger; + } + + }