You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.5 KiB
49 lines
1.5 KiB
14 years ago
|
<?php
|
||
14 years ago
|
/**
|
||
|
* @link http://www.yiiframework.com/
|
||
12 years ago
|
* @copyright Copyright (c) 2008 Yii Software LLC
|
||
14 years ago
|
* @license http://www.yiiframework.com/license/
|
||
|
*/
|
||
14 years ago
|
|
||
|
namespace yii\base;
|
||
|
|
||
|
/**
|
||
14 years ago
|
* Event is the base class for all event classes.
|
||
14 years ago
|
*
|
||
|
* It encapsulates the parameters associated with an event.
|
||
14 years ago
|
* The [[sender]] property describes who raises the event.
|
||
|
* And the [[handled]] property indicates if the event is handled.
|
||
|
* If an event handler sets [[handled]] to be true, the rest of the
|
||
14 years ago
|
* uninvoked handlers will no longer be called to handle the event.
|
||
12 years ago
|
*
|
||
|
* Additionally, when attaching an event handler, extra data may be passed
|
||
|
* and be available via the [[data]] property when the event handler is invoked.
|
||
14 years ago
|
*
|
||
|
* @author Qiang Xue <qiang.xue@gmail.com>
|
||
14 years ago
|
* @since 2.0
|
||
14 years ago
|
*/
|
||
12 years ago
|
class Event extends Object
|
||
14 years ago
|
{
|
||
|
/**
|
||
13 years ago
|
* @var string the event name. This property is set by [[Component::trigger()]].
|
||
14 years ago
|
* Event handlers may use this property to check what event it is handling.
|
||
|
*/
|
||
|
public $name;
|
||
|
/**
|
||
12 years ago
|
* @var object the sender of this event. If not set, this property will be
|
||
|
* set as the object whose "trigger()" method is called.
|
||
14 years ago
|
*/
|
||
|
public $sender;
|
||
|
/**
|
||
|
* @var boolean whether the event is handled. Defaults to false.
|
||
14 years ago
|
* When a handler sets this to be true, the event processing will stop and
|
||
|
* ignore the rest of the uninvoked event handlers.
|
||
14 years ago
|
*/
|
||
14 years ago
|
public $handled = false;
|
||
14 years ago
|
/**
|
||
12 years ago
|
* @var mixed the data that is passed to [[Component::on()]] when attaching an event handler.
|
||
|
* Note that this varies according to which event handler is currently executing.
|
||
14 years ago
|
*/
|
||
13 years ago
|
public $data;
|
||
14 years ago
|
}
|