1: <?php
 2: /**
 3:  * CConsoleCommandEvent class file.
 4:  *
 5:  * @author Evgeny Blinov <e.a.blinov@gmail.com>
 6:  * @link http://www.yiiframework.com/
 7:  * @copyright 2008-2013 Yii Software LLC
 8:  * @license http://www.yiiframework.com/license/
 9:  */
10: 
11: /**
12:  * CConsoleCommandEvent class.
13:  *
14:  * CConsoleCommandEvent represents the event parameters needed by events raised by a console command.
15:  *
16:  * @author Evgeny Blinov <e.a.blinov@gmail.com>
17:  * @package system.console
18:  * @since 1.1.11
19:  */
20: class CConsoleCommandEvent extends CEvent
21: {
22:     /**
23:      * @var string the action name
24:      */
25:     public $action;
26:     /**
27:      * @var boolean whether the action should be executed.
28:      * If this property is set true by the event handler, the console command action will quit after handling this event.
29:      * If false, which is the default, the normal execution cycles will continue, including performing the action and calling
30:      * {@link CConsoleCommand::afterAction}.
31:      */
32:     public $stopCommand=false;
33:     /**
34:      * @var integer exit code of application.
35:      * This property is available in {@link CConsoleCommand::onAfterAction} event and will be set to the exit code
36:      * returned by the console command action. You can set it to change application exit code.
37:      */
38:     public $exitCode;
39: 
40:     /**
41:      * Constructor.
42:      * @param mixed $sender sender of the event
43:      * @param string $params the parameters to be passed to the action method.
44:      * @param string $action the action name
45:      * @param integer $exitCode the application exit code
46:      */
47:     public function __construct($sender=null,$params=null,$action=null,$exitCode=0){
48:         parent::__construct($sender,$params);
49:         $this->action=$action;
50:         $this->exitCode=$exitCode;
51:     }
52: }