LazyServiceEventListener
用于从服务容器中提取事件侦听器的装饰器。
最终
| 自版本 |
2.0.0 |
|---|---|
| 包 |
Joomla 框架 |
方法
__construct
构造函数。
__construct(\Psr\Container\ContainerInterface container, serviceId, method = '') :
| 自版本 |
2.0.0 |
|---|---|
| 抛出 |
|
参数
- 容器
ContainerInterface当应执行服务时,从中加载服务的服务容器- 服务 ID
string要使用的容器中服务的 ID- 方法
string如有必要,要调用的服务方法。如果留空,则服务必须是可调用的;(即在类上具有__invoke()方法)
返回值
混合
__invoke
从容器中加载服务以侦听事件。
__invoke(\Joomla\Event\EventInterface event) :
| 自版本 |
2.0.0 |
|---|---|
| 抛出 |
|
参数
- 事件
EventInterface要处理的事件
返回值
空
属性
容器
要从中加载服务的服务容器
| 自版本 |
2.0.0 |
|---|
类型
ContainerInterface
服务 ID
要使用的容器中服务的 ID
| 自版本 |
2.0.0 |
|---|
类型
字符串
方法
要调用的服务方法
| 自版本 |
2.0.0 |
|---|
类型
字符串