|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* TControl, TControlCollection, TEventParameter and INamingContainer class file |
|
4
|
|
|
* |
|
5
|
|
|
* @author Qiang Xue <[email protected]> |
|
6
|
|
|
* @link https://github.com/pradosoft/prado |
|
7
|
|
|
* @license https://github.com/pradosoft/prado/blob/master/LICENSE |
|
8
|
|
|
*/ |
|
9
|
|
|
|
|
10
|
|
|
namespace Prado\Web\UI; |
|
11
|
|
|
|
|
12
|
|
|
/** |
|
13
|
|
|
* TBroadcastEventParameter class |
|
14
|
|
|
* |
|
15
|
|
|
* TBroadcastEventParameter encapsulates the parameter data for |
|
16
|
|
|
* events that are broadcasted. The name of of the event is specified via |
|
17
|
|
|
* {@link setName Name} property while the event parameter is via |
|
18
|
|
|
* {@link setParameter Parameter} property. |
|
19
|
|
|
* |
|
20
|
|
|
* @author Qiang Xue <[email protected]> |
|
21
|
|
|
* @since 3.0 |
|
22
|
|
|
*/ |
|
23
|
|
|
class TBroadcastEventParameter extends \Prado\TEventParameter |
|
24
|
|
|
{ |
|
25
|
|
|
/** |
|
26
|
|
|
* Constructor. |
|
27
|
|
|
* @param string $name name of the broadcast event |
|
28
|
|
|
* @param null|mixed $parameter parameter of the broadcast event |
|
29
|
|
|
*/ |
|
30
|
|
|
public function __construct(string $name = '', mixed $parameter = null) |
|
31
|
|
|
{ |
|
32
|
|
|
parent::setEventName($name); |
|
33
|
|
|
parent::__construct($parameter); |
|
34
|
|
|
} |
|
35
|
|
|
|
|
36
|
|
|
/** |
|
37
|
|
|
* @return string name of the broadcast event |
|
38
|
|
|
*/ |
|
39
|
|
|
public function getName() |
|
40
|
|
|
{ |
|
41
|
|
|
return parent::getEventName(); |
|
42
|
|
|
} |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* @param string $value name of the broadcast event |
|
46
|
|
|
*/ |
|
47
|
|
|
public function setName($value) |
|
48
|
|
|
{ |
|
49
|
|
|
parent::setEventName($value); |
|
50
|
|
|
} |
|
51
|
|
|
|
|
52
|
|
|
/** |
|
53
|
|
|
* @param string $value name of the broadcast event |
|
54
|
|
|
* @since 4.2.3 |
|
55
|
|
|
*/ |
|
56
|
|
|
public function setEventName(string $value) |
|
57
|
|
|
{ |
|
58
|
|
|
if ($this->getEventName() === '') { |
|
59
|
|
|
parent::setEventName($value); |
|
60
|
|
|
} |
|
61
|
|
|
} |
|
62
|
|
|
|
|
63
|
|
|
} |
|
64
|
|
|
|