EventAwareInterface

Extends \Joomla\Event\DispatcherAwareInterface

Interface defining application that can trigger Joomla 3.x style events

deprecated
since

4.0.0

deprecated

5.0 This interface will be removed as the Joomla 3.x compatibility layer will be removed

Methods

getDispatcher

Get the event dispatcher.

getDispatcher() : \Joomla\Event\DispatcherInterface
since

4.0.0

throws

\UnexpectedValueExceptionMay be thrown if the dispatcher has not been set.

Response

\Joomla\Event\DispatcherInterface

triggerEvent

Calls all handlers associated with an event group.

triggerEvent(string $eventName, array|\Joomla\Event\Event $args = array()) : array
deprecated

This is a legacy method, implementing old-style (Joomla! 3.x) plugin calls. It's best to go directly through the Dispatcher and handle the returned EventInterface object instead of going through this method. This method is deprecated and will be removed in Joomla! 5.x.

This method will only return the 'result' argument of the event

since

4.0.0

throws

\InvalidArgumentException

deprecated

5.0

Arguments

$eventName

stringThe event name.

$args

array|\Joomla\Event\EventAn array of arguments or an Event object (optional).

Response

arrayAn array of results from each function call. Note this will be an empty array if no dispatcher is set.