Traits

CoreEventAware

Returns the most suitable event class for a Joomla core event name

« More »

ReshapeArgumentsAware

A Trait to reshape arguments maintaining b/c with legacy plugin events.

Old plugin event handlers expect positional arguments, not named arguments, since they are simple PHP methods, e.g. public onExample($foo, $bar, $baz). Concrete Event classes, however, use named arguments which can be passed in any order. The following two examples are equivalent: $event1 = new ConcreteEventClass('onExample', ['foo' => 1, 'bar' => 2, 'baz' => 3]; $event2 = new ConcreteEventClass('onExample', ['bar' => 2, 'baz' => 3, 'foo' => 1,]; However, this means that the internal $arguments property of the event object holds the named arguments in a **different** order in each case. When the event handler is aware of the ConcreteEventClass it can retrieve named arguments and all is good in the world. However, when you have a legacy plugin listener registered through CMSPlugin::registerLegacyListener you have a major problem! The legacy listener is passing the arguments **positionally**, in the order they were added to the Event object. In the previous example, $event1 would work as expected because the foo, bar, and baz arguments were given in the same order legacy listeners expected them. On the other hand, $event2 would fail miserably because the call order would be $bar, $baz, $foo which is NOT what the legacy listener expected. The only way to fix that is to *reshape the argument* in the concrete event's constructor so that the order of arguments is guaranteed to be the same as expected by legacy listeners. Moreover, since Joomla is passing all arguments (except the 'result' argument) blindly to the legacy listener we must ensure that a. all necessary arguments are set and b. any other named arguments do NOT exist. Otherwise our legacy listeners would receive the wrong number of positional arguments and break. All this is achieved by the reshapeArguments() method in this trait which has to be called in the constructor of the concrete event class. This trait is marked as deprecated with a removal target of 5.0 because in Joomla 5 we will only be using concrete event classes with named arguments, removing legacy listeners and their positional arguments headaches.
« More »

Classes

AbstractEvent

This class implements the base Event object used system-wide to offer orthogonality. Core objects such as Models, Controllers, etc create such events on-the-fly and dispatch them through the application's Dispatcher (colloquially known as the "Joomla! plugin system"). This way a suitable plugin, typically a "system" plugin, can modify the behaviour of any internal class, providing system-wide services such as tags, content versioning, comments or even low-level services such as the implementation of created/modified/locked behaviours, record hit counter etc.

You can create a new Event with something like this: $event = AbstractEvent::create('onModelBeforeSomething', $myModel, $arguments); You can access the subject object from your event Listener using $event['subject']. It is up to your listener to determine whether it should apply its functionality against the subject. This AbstractEvent class implements a mutable event which is allowed to change its arguments at runtime. This is generally unadvisable. It's best to use AbstractImmutableEvent instead and constrict all your interaction to the subject class.
« More »

AbstractImmutableEvent

This class implements the immutable base Event object used system-wide to offer orthogonality.

« More »

AfterExtensionBootEvent

Event class for representing the extensions's `onBeforeExtensionBoot` event

« More »

BeforeExtensionBootEvent

Event class for representing the extensions's `onBeforeExtensionBoot` event

« More »

ErrorEvent

Event class for representing the application's `onError` event

« More »

GenericEvent

This class gives a concrete implementation of the AbstractEvent class.

« More »

Classes

BeforeBatchEvent

Event class for modifying a table object before a batch event is applied

« More »

Classes

BeforeDisplayMethods

Concrete Event class for the onUserMultifactorBeforeDisplayMethods event

« More »

Callback

Concrete Event class for the onUserMultifactorCallback event

« More »

Captive

Concrete Event class for the onUserMultifactorCaptive event

« More »

GetMethod

Concrete Event class for the onUserMultifactorGetMethod event

« More »

GetSetup

Concrete Event class for the onUserMultifactorGetSetup event

« More »

NotifyActionLog

Concrete event class for the custom events used to notify the User Action Log plugin about Two Factor Authentication actions.

« More »

SaveSetup

Concrete Event class for the onUserMultifactorSaveSetup event

« More »

Validate

Concrete Event class for the onUserMultifactorValidate event

« More »

Classes

Ajax

Concrete event class for the onAjaxWebauthn event

« More »

AjaxChallenge

Concrete event class for the onAjaxWebauthnChallenge event

« More »

AjaxCreate

Concrete event class for the onAjaxWebauthnCreate event

« More »

AjaxDelete

Concrete event class for the onAjaxWebauthnDelete event

« More »

AjaxInitCreate

Concrete event class for the onAjaxWebauthnInitcreate event

« More »

AjaxLogin

Concrete event class for the onAjaxWebauthnLogin event

« More »

AjaxSaveLabel

Concrete event class for the onAjaxWebauthnSavelabel event

« More »

Classes

GetIconEvent

Event class for the onGetIcon event.

« More »

Traits

ResultAware

This Trait partially implements the ResultAwareInterface for mutable and immutable events.

You must additionally implement the typeCheckResult method or use one of the ResultType*Aware traits in your Event handler.
« More »

ResultTypeArrayAware

This Trait partially implements the ResultAwareInterface for type checking.

Events using this Trait (and the ResultAware trait) will expect event handlers to set results of an Array type.
« More »

ResultTypeBooleanAware

This Trait partially implements the ResultAwareInterface for type checking.

Events using this Trait (and the ResultAware trait) will expect event handlers to set results of a Boolean type.
« More »

ResultTypeFloatAware

This Trait partially implements the ResultAwareInterface for type checking.

Events using this Trait (and the ResultAware trait) will expect event handlers to set results of a Float type.
« More »

ResultTypeIntegerAware

This Trait partially implements the ResultAwareInterface for type checking.

Events using this Trait (and the ResultAware trait) will expect event handlers to set results of an Integer type.
« More »

ResultTypeMixedAware

This Trait partially implements the ResultAwareInterface for type checking.

Events using this Trait (and the ResultAware trait) will expect event handlers to set results of a any type. THIS IS A COP OUT! If you expect a nullable or union type it's best to implement the typeCheckResult method yourself to check for the exact types you expect.
« More »

ResultTypeNumericAware

This Trait partially implements the ResultAwareInterface for type checking.

Events using this Trait (and the ResultAware trait) will expect event handlers to set results of a Numeric type.
« More »

ResultTypeObjectAware

This Trait partially implements the ResultAwareInterface for type checking.

Events using this Trait (and the ResultAware trait) will expect event handlers to set results of an object type. If you do not set a list of acceptable result classes any PHP object will satisfy this type check.
« More »

ResultTypeStringAware

This Trait partially implements the ResultAwareInterface for type checking.

Events using this Trait (and the ResultAware trait) will expect event handlers to set results of a String type.
« More »

Interfaces

ResultAwareInterface

Defines an Event which has an append-only array argument named 'result'.

This is used for Events whose handlers are expected to return something when called, similar to how many plugin events worked in earlier versions of Joomla. This interface is partially implemented by the ResultAware trait. The typeCheckResult method is implemented by the various ResultType*Aware traits. Your event needs to use both the ResultAware trait and one of the ResultType*Aware traits. For example, if your event returns boolean results you need to use the ResultAware and ResultTypeBooleanAware traits in your event.
« More »

Classes

AbstractEvent

Event class for the Table's events

« More »

AfterBindEvent

Event class for JTable's onAfterBind event

« More »

AfterCheckinEvent

Event class for JTable's onAfterCheckin event

« More »

AfterCheckoutEvent

Event class for JTable's onAfterCheckout event

« More »

AfterDeleteEvent

Event class for JTable's onAfterDelete event

« More »

AfterHitEvent

Event class for JTable's onAfterHit event

« More »

AfterLoadEvent

Event class for JTable's onAfterLoad event

« More »

AfterMoveEvent

Event class for JTable's onAfterMove event

« More »

AfterPublishEvent

Event class for JTable's onAfterPublish event

« More »

AfterReorderEvent

Event class for JTable's onAfterReorder event

« More »

AfterResetEvent

Event class for JTable's onAfterReset event

« More »

AfterStoreEvent

Event class for JTable's onAfterStore event

« More »

BeforeBindEvent

Event class for JTable's onBeforeBind event

« More »

BeforeCheckinEvent

Event class for JTable's onBeforeCheckin event

« More »

BeforeCheckoutEvent

Event class for JTable's onBeforeCheckout event

« More »

BeforeDeleteEvent

Event class for JTable's onBeforeDelete event

« More »

BeforeHitEvent

Event class for JTable's onBeforeHit event

« More »

BeforeLoadEvent

Event class for JTable's onBeforeLoad event

« More »

BeforeMoveEvent

Event class for JTable's onBeforeMove event

« More »

BeforePublishEvent

Event class for JTable's onBeforePublish event

« More »

BeforeReorderEvent

Event class for JTable's onBeforeReorder event

« More »

BeforeResetEvent

Event class for JTable's onBeforeReset event

« More »

BeforeStoreEvent

Event class for JTable's onBeforeStore event

« More »

CheckEvent

Event class for JTable's onCheck event

« More »

ObjectCreateEvent

Event class for JTable's onObjectCreate event

« More »

SetNewTagsEvent

Event class for JTable's onSetNewTags event

« More »

Classes

DisplayEvent

Event class for WebAsset events

« More »

Classes

AbstractEvent

Event class for WebAsset events

« More »

WebAssetRegistryAssetChanged

Event class for WebAssetRegistry "asset changed" events

« More »

Classes

AbstractEvent

Event class for WebAsset events

« More »

WorkflowFunctionalityUsedEvent

Event class for Workflow Functionality Used events

« More »

WorkflowTransitionEvent

Event class for Workflow Functionality Used events

« More »