From f267f4623fdf53b0182aa65d4bbe5aa08af51b2a Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 30 Dec 2013 18:25:38 +0400 Subject: [PATCH] reverted $isValid for events. --- framework/yii/base/ActionEvent.php | 13 ++++++++----- framework/yii/base/Event.php | 7 +------ framework/yii/base/MailEvent.php | 8 +++++++- framework/yii/base/ModelEvent.php | 10 +++++++--- framework/yii/base/ViewEvent.php | 13 +++++++------ 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/framework/yii/base/ActionEvent.php b/framework/yii/base/ActionEvent.php index adfeddc..293d5bd 100644 --- a/framework/yii/base/ActionEvent.php +++ b/framework/yii/base/ActionEvent.php @@ -11,10 +11,7 @@ namespace yii\base; * ActionEvent represents the event parameter used for an action event. * * By setting the [[isValid]] property, one may control whether to continue running the action. - * @property boolean $isValid Event handlers of - * [[Controller::EVENT_BEFORE_ACTION]] may set this property to decide whether - * to continue running the current action. - * + * * @author Qiang Xue * @since 2.0 */ @@ -28,6 +25,12 @@ class ActionEvent extends Event * @var mixed the action result. Event handlers may modify this property to change the action result. */ public $result; + /** + * @var boolean whether to continue running the action. Event handlers of + * [[Controller::EVENT_BEFORE_ACTION]] may set this property to decide whether + * to continue running the current action. + */ + public $isValid = true; /** * Constructor. @@ -39,4 +42,4 @@ class ActionEvent extends Event $this->action = $action; parent::__construct($config); } -} +} \ No newline at end of file diff --git a/framework/yii/base/Event.php b/framework/yii/base/Event.php index 4c8ffcb..ebd7193 100644 --- a/framework/yii/base/Event.php +++ b/framework/yii/base/Event.php @@ -46,11 +46,6 @@ class Event extends Object */ public $data; - /** - * @var boolean whether to continue execution of process or not. - */ - public $isValid = true; - private static $_events = []; /** @@ -185,4 +180,4 @@ class Event extends Object } } while (($class = get_parent_class($class)) !== false); } -} +} \ No newline at end of file diff --git a/framework/yii/base/MailEvent.php b/framework/yii/base/MailEvent.php index 188c7d3..3e0ae76 100644 --- a/framework/yii/base/MailEvent.php +++ b/framework/yii/base/MailEvent.php @@ -24,7 +24,13 @@ class MailEvent extends Event */ public $message; /** - * + * @var boolean if message send was successful */ public $isSuccessful; + /** + * @var boolean whether to continue send. Event handlers of + * [[\yii\mail\BaseMailer::EVENT_BEFORE_SEND]] may set this property to decide whether + * to continue send or not. + */ + public $isValid = true; } diff --git a/framework/yii/base/ModelEvent.php b/framework/yii/base/ModelEvent.php index b4b602d..f10f83a 100644 --- a/framework/yii/base/ModelEvent.php +++ b/framework/yii/base/ModelEvent.php @@ -11,11 +11,15 @@ namespace yii\base; * ModelEvent class. * * ModelEvent represents the parameter needed by model events. - * @property boolean $isValid A model is in valid status if it passes validations or certain checks. - * + * * @author Qiang Xue * @since 2.0 */ class ModelEvent extends Event { -} + /** + * @var boolean whether the model is in valid status. Defaults to true. + * A model is in valid status if it passes validations or certain checks. + */ + public $isValid = true; +} \ No newline at end of file diff --git a/framework/yii/base/ViewEvent.php b/framework/yii/base/ViewEvent.php index 70ba96d..ec4d461 100644 --- a/framework/yii/base/ViewEvent.php +++ b/framework/yii/base/ViewEvent.php @@ -10,11 +10,6 @@ namespace yii\base; /** * ViewEvent represents events triggered by the [[View]] component. * - * @property boolean $isValid whether to continue rendering the view file. Event handlers of - *[[View::EVENT_BEFORE_RENDER]] may set this property to decide whether - * to continue rendering the current view file. - * - * * @author Qiang Xue * @since 2.0 */ @@ -31,6 +26,12 @@ class ViewEvent extends Event * @var string the view file path that is being rendered by [[View::renderFile()]]. */ public $viewFile; + /** + * @var boolean whether to continue rendering the view file. Event handlers of + * [[View::EVENT_BEFORE_RENDER]] may set this property to decide whether + * to continue rendering the current view file. + */ + public $isValid = true; /** * Constructor. @@ -42,4 +43,4 @@ class ViewEvent extends Event $this->viewFile = $viewFile; parent::__construct($config); } -} +} \ No newline at end of file