|
1
|
|
|
<?php |
|
2
|
|
|
defined('ROOT_PATH') or exit('Access denied'); |
|
3
|
|
|
/** |
|
4
|
|
|
* TNH Framework |
|
5
|
|
|
* |
|
6
|
|
|
* A simple PHP framework using HMVC architecture |
|
7
|
|
|
* |
|
8
|
|
|
* This content is released under the GNU GPL License (GPL) |
|
9
|
|
|
* |
|
10
|
|
|
* Copyright (C) 2017 Tony NGUEREZA |
|
11
|
|
|
* |
|
12
|
|
|
* This program is free software; you can redistribute it and/or |
|
13
|
|
|
* modify it under the terms of the GNU General Public License |
|
14
|
|
|
* as published by the Free Software Foundation; either version 3 |
|
15
|
|
|
* of the License, or (at your option) any later version. |
|
16
|
|
|
* |
|
17
|
|
|
* This program is distributed in the hope that it will be useful, |
|
18
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
19
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
20
|
|
|
* GNU General Public License for more details. |
|
21
|
|
|
* |
|
22
|
|
|
* You should have received a copy of the GNU General Public License |
|
23
|
|
|
* along with this program; if not, write to the Free Software |
|
24
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
25
|
|
|
*/ |
|
26
|
|
|
|
|
27
|
|
|
/** |
|
28
|
|
|
* This class represent the event detail to dispatch to correspond listener |
|
29
|
|
|
*/ |
|
30
|
|
|
class EventInfo{ |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* The event name |
|
34
|
|
|
* @var string |
|
35
|
|
|
*/ |
|
36
|
|
|
public $name; |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* The event data to send to the listeners |
|
40
|
|
|
* @var mixed |
|
41
|
|
|
*/ |
|
42
|
|
|
public $payload; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* If the listeners need return the event after treatment or not, false means no need |
|
46
|
|
|
* return true need return the event. |
|
47
|
|
|
* @var boolean |
|
48
|
|
|
*/ |
|
49
|
|
|
public $returnBack; |
|
50
|
|
|
|
|
51
|
|
|
/** |
|
52
|
|
|
* This variable indicates if need stop the event propagation |
|
53
|
|
|
* @var boolean |
|
54
|
|
|
*/ |
|
55
|
|
|
public $stop; |
|
56
|
|
|
|
|
57
|
|
|
public function __construct($name, $payload = array(), $returnBack = false, $stop = false){ |
|
58
|
|
|
$this->name = $name; |
|
59
|
|
|
$this->payload = $payload; |
|
60
|
|
|
$this->returnBack = $returnBack; |
|
61
|
|
|
$this->stop = $stop; |
|
62
|
|
|
} |
|
63
|
|
|
} |
|
64
|
|
|
|