PHP Class Webiny\Component\EventManager\EventListener

A new EventListener is created each time you subscribe to an event.
Inheritance: use trait Webiny\Component\StdLib\StdLibTrait
Datei anzeigen Open project: Webiny/Framework

Public Methods

Method Description
getHandler ( ) : mixed Get handler object
getMethod ( ) : string Get handler method
getPriority ( ) : integer Get listener priority
handler ( $handler ) Set handler for event. Can be a callable, class name or class instance.
method ( string $method ) Set method to be called on handler.
If not set, default method will be called: handle(Event $event)
priority ( $priority ) Set listener priority between 101 and 999.
Default priority is 101.
Bigger values mean higher listener priority, and will be executed first.

Method Details

getHandler() public method

Get handler object
public getHandler ( ) : mixed
return mixed

getMethod() public method

Get handler method
public getMethod ( ) : string
return string

getPriority() public method

Get listener priority
public getPriority ( ) : integer
return integer

handler() public method

Set handler for event. Can be a callable, class name or class instance.
public handler ( $handler )
$handler

method() public method

Set method to be called on handler.
If not set, default method will be called: handle(Event $event)
public method ( string $method )
$method string Method to call on handler

priority() public method

Set listener priority between 101 and 999.
Default priority is 101.
Bigger values mean higher listener priority, and will be executed first.
public priority ( $priority )
$priority