summaryrefslogtreecommitdiff
path: root/framework/Base/TEvent.php
diff options
context:
space:
mode:
authorrojaro <>2009-07-13 14:12:10 +0000
committerrojaro <>2009-07-13 14:12:10 +0000
commit2ecfe49532dbfc53d75a32e68df643b7af13dc1f (patch)
tree6d0a0ca67e1e0cdd1c2ff9403bfb760abb87d61c /framework/Base/TEvent.php
parent78af2b4630ccde4b03659a259f739f83ae0de9ec (diff)
- Models, Behaviors ...
Diffstat (limited to 'framework/Base/TEvent.php')
-rw-r--r--framework/Base/TEvent.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/framework/Base/TEvent.php b/framework/Base/TEvent.php
new file mode 100644
index 00000000..0f64e89d
--- /dev/null
+++ b/framework/Base/TEvent.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * CEvent is the base class for all event classes.
+ *
+ * It encapsulates the parameters associated with an event.
+ * The {@link sender} property describes who raises the event.
+ * And the {@link handled} property indicates if the event is handled.
+ * If an event handler sets {@link handled} to true, those handlers
+ * that are not invoked yet will not be invoked anymore.
+ *
+ * @author Qiang Xue <qiang.xue@gmail.com>
+ * @version $Id: CComponent.php 978 2009-05-06 03:36:09Z qiang.xue $
+ * @package system.base
+ * @since 1.0
+ */
+class TEvent extends TComponent
+{
+ /**
+ * @var object the sender of this event
+ */
+ public $sender;
+ /**
+ * @var boolean whether the event is handled. Defaults to false.
+ * When a handler sets this true, the rest uninvoked handlers will not be invoked anymore.
+ */
+ public $handled=false;
+
+ /**
+ * Constructor.
+ * @param mixed sender of the event
+ */
+ public function __construct($sender=null)
+ {
+ $this->sender=$sender;
+ }
+} \ No newline at end of file