Event
扩展 AbstractEvent默认事件类。
| 自 |
1.0 |
|---|---|
| 包 |
Joomla 框架 |
方法
__construct
构造函数。
__construct( name, mixed||string|int arguments = []) :
| 自 |
1.0 |
|---|
参数
- name
string事件名称。- arguments
array<string|int, mixed>事件参数。
响应
混合
__serialize
序列化事件。
__serialize() : mixed||string|int
| 自 |
2.0.0 |
|---|
响应
array<string|int, mixed>要序列化的数据
__unserialize
反序列化事件。
__unserialize(mixed||string|int data) :
| 自 |
2.0.0 |
|---|
参数
- data
array<string|int, mixed>已序列化的事件。
响应
空
addArgument
添加事件参数,仅当它不存在时。
addArgument( name, value) :
| 自 |
1.0 |
|---|
参数
- name
string参数名称。- value
mixed参数值。
响应
$this
clearArguments
清除所有事件参数。
clearArguments() : mixed||string|int
| 自 |
1.0 |
|---|
响应
array<string|int, mixed>旧参数。
count
计算参数数量。
count() :
| 自 |
1.0 |
|---|
响应
int参数数量。
getArgument
获取事件参数值。
getArgument( name, default = null) :
| 自 |
1.0 |
|---|
参数
- name
string参数名称。- 默认
mixed如果未找到,则为默认值。
响应
mixed参数值或默认值。
getArguments
获取所有事件参数。
getArguments() : mixed||string|int
| 自 |
1.0 |
|---|
响应
array<string|int, mixed>一个关联数组,参数名称作为键,其值作为值。
getName
获取事件名称。
getName() :
| 自 |
1.0 |
|---|
响应
string事件名称。
hasArgument
判断给定的事件参数是否存在。
hasArgument( name) :
| 自 |
1.0 |
|---|
参数
- name
string参数名称。
响应
bool如果存在则为真,否则为假。
isStopped
判断事件传播是否已停止。
isStopped() :
| 自 |
1.0 |
|---|
响应
bool如果已停止则为真,否则为假。
offsetExists
判断给定的事件参数是否存在。
offsetExists( name) :
| 自 |
1.0 |
|---|
参数
- name
string参数名称。
响应
bool如果存在则为真,否则为假。
offsetGet
获取事件参数值。
offsetGet( name) :
| 自 |
1.0 |
|---|
参数
- name
string参数名称。
响应
mixed参数值,如果不存在则为 null。
offsetSet
设置事件参数的值。
offsetSet( name, value) :
| 自 |
1.0 |
|---|---|
| 抛出 |
|
参数
- name
string参数名称。- value
mixed参数值。
响应
空
offsetUnset
删除事件参数。
offsetUnset( name) :
| 自 |
1.0 |
|---|
参数
- name
string参数名称。
响应
空
removeArgument
删除事件参数。
removeArgument( name) :
| 自 |
1.0 |
|---|
参数
- name
string参数名称。
响应
mixed旧参数值,如果不存在则为 null。
serialize
序列化事件。
serialize() :
| 自 |
1.0 |
|---|
响应
string已序列化的事件。
setArgument
向事件添加参数。
setArgument( name, value) :
| 自 |
1.0 |
|---|
参数
- name
string参数名称。- value
mixed值。
响应
$this
stop
停止事件传播。
stop() :
| 自 |
1.0 |
|---|---|
| 已弃用 |
3.0 使用 stopPropagation 代替 |
响应
空
stopPropagation
停止将事件传播到其他事件监听器。
stopPropagation() :
| 自 |
2.0.0 |
|---|
响应
空
unserialize
反序列化事件。
unserialize( serialized) :
| 自 |
1.0 |
|---|
参数
- 序列化
string已序列化的事件。
响应
空
属性
name
事件名称。
| 自 |
1.0 |
|---|
类型
字符串
arguments
事件参数。
| 自 |
1.0 |
|---|
类型
array<string|int, mixed>
stopped
一个标志,用于查看事件传播是否已停止。
| 自 |
1.0 |
|---|
类型
布尔