class EventSubscriber implements EventSubscriberInterface

Base class for event subscribers.

Properties

protected array $subscribedEvents Events subscribed

Methods

__construct(string|null $eventName = null, int $priority = 0, string|null $hadnlerMethod = null)

Constructor

bool
execute(EventInterface $event)

Subscriber code executed.

void
subscribe(string $eventName, string|null $hadnlerMethod = null, int $priority = 0)

Subscribe to event.

array
getSubscribedEvents()

Return subscribed events.

Details

at line 33
__construct(string|null $eventName = null, int $priority = 0, string|null $hadnlerMethod = null)

Constructor

Parameters

string|null $eventName
int $priority
string|null $hadnlerMethod

at line 46
bool execute(EventInterface $event)

Subscriber code executed.

Parameters

EventInterface $event

Return Value

bool

at line 58
void subscribe(string $eventName, string|null $hadnlerMethod = null, int $priority = 0)

Subscribe to event.

Parameters

string $eventName
string|null $hadnlerMethod
int $priority

Return Value

void

at line 73
array getSubscribedEvents()

Return subscribed events.

Return Value

array