EventListener
in package
implements
EventListenerInterface
AbstractYes
Base class for event listener.
Table of Contents
Interfaces
- EventListenerInterface
- Event listener interface
Properties
- $eventName : string|null
- Event name
- $priority : int
- Event priority
Methods
- __construct() : mixed
- Constructor
- execute() : mixed
- Subscriber code executed.
- getEventName() : string
- Get event name
- getPriority() : int
- Get priority
- subscribe() : void
- Subscribe to event
Properties
$eventName
Event name
protected
string|null
$eventName
$priority
Event priority
protected
int
$priority
= 0
Methods
__construct()
Constructor
public
__construct([string|null $eventName = null ][, int $priority = 0 ]) : mixed
Parameters
- $eventName : string|null = null
- $priority : int = 0
execute()
Subscriber code executed.
public
abstract execute(EventInterface $event) : mixed
Parameters
- $event : EventInterface
getEventName()
Get event name
public
getEventName() : string
Return values
stringgetPriority()
Get priority
public
getPriority() : int
Return values
intsubscribe()
Subscribe to event
public
subscribe(string $eventName[, int $priority = 0 ]) : void
Parameters
- $eventName : string
- $priority : int = 0