Returns the most suitable event class for a Joomla core event name
« More »
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 7.0 because in Joomla 7 we will only
be using concrete event classes with named arguments, removing legacy listeners and their
positional arguments headaches.
« More »
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 »
This class implements the immutable base Event object used system-wide to offer orthogonality.
« More »
Event class for representing the extensions's `onBeforeExtensionBoot` event
« More »
Event class for representing the extensions's `onBeforeExtensionBoot` event
« More »
Event class for representing the application's `onError` event
« More »
This class gives a concrete implementation of the AbstractEvent class.
« More »
Event class for AfterInitialiseDocument event
« More »
Class for AfterInitialise event
« More »
Class for Application Configuration events
« More »
Class for Application Configuration events
« More »
Class for Application's Document events
« More »
Class for BeforeCompileHead event
« More »
Class for Application Configuration events
« More »
Class for Fork event for DaemonApplication
« More »
Class for ReceiveSignal event for DaemonApplication
« More »
Class for Content event.
Example:
new AfterDisplayEvent('onEventName', ['context' => 'com_example.example', 'subject' => $contentObject, 'params' => $params, 'page' => $pageNum]);
« More »
Class for Content event.
Example:
new AfterTitleEvent('onEventName', ['context' => 'com_example.example', 'subject' => $contentObject, 'params' => $params, 'page' => $pageNum]);
« More »
Class for Content event.
Example:
new BeforeDisplayEvent('onEventName', ['context' => 'com_example.example', 'subject' => $contentObject, 'params' => $params, 'page' => $pageNum]);
« More »
Base class for Content events
« More »
Class for Content event.
Example:
new ContentPrepareEvent('onEventName', ['context' => 'com_example.example', 'subject' => $contentObject, 'params' => $params, 'page' => $pageNum]);
« More »
Base class for Extension events
« More »
Base class for Joomla Update events
« More »
Class for Joomla Auto Update events
« More »
Class for Model event.
Example:
new AfterCategoryChangeStateEvent('onEventName', ['context' => $extension, 'subject' => $primaryKeys, 'value' => $newState]);
« More »
Class for Model event.
Example:
new AfterChangeStateEvent('onEventName', ['context' => 'com_example.example', 'subject' => $primaryKeys, 'value' => $newState]);
« More »
Class for Model event.
Example:
new AfterDeleteEvent('onEventName', ['context' => 'com_example.example', 'subject' => $itemObjectToDelete]);
« More »
Class for Model event.
Example:
new AfterSaveEvent('onEventName', ['context' => 'com_example.example', 'subject' => $itemObjectToSave, 'isNew' => $isNew]);
« More »
Class for Finder events.
Example:
new BeforeIndexEvent('onEventName', []);
« More »
Class for Model event.
Example:
new BeforeSaveEvent('onEventName', ['context' => 'com_example.example', 'subject' => $itemObjectToSave, 'isNew' => $isNew);
« More »
Class for Finder events.
Example:
new BuildIndexEvent('onEventName', []);
« More »
Class for Finder events.
Example:
new GarbageCollectionEvent('onEventName', []);
« More »
Class for Finder events.
Example:
new PrepareContentEvent('onEventName', ['subject' => $item]);
« More »
Class for Finder events.
Example:
new ResultEvent('onEventName', ['subject' => $item, 'query' => $query]);
« More »
Class for Finder events.
Example:
new StartIndexEvent('onEventName', []);
« More »
Class for Model event.
Example:
new AfterCategoryChangeStateEvent('onEventName', ['context' => $extension, 'subject' => $primaryKeys, 'value' => $newState]);
« More »
Class for Model event.
Example:
new AfterChangeStateEvent('onEventName', ['context' => 'com_example.example', 'subject' => $primaryKeys, 'value' => $newState]);
« More »
Class for Model event.
Example:
new AfterDeleteEvent('onEventName', ['context' => 'com_example.example', 'subject' => $itemObjectToDelete]);
« More »
Class for Model event.
Example:
new AfterSaveEvent('onEventName', ['context' => 'com_example.example', 'subject' => $itemObjectToSave, 'isNew' => $isNew, 'data' => $submittedData]);
« More »
Event class for modifying a table object before a batch event is applied
« More »
Class for Model event.
Example:
new BeforeChangeStateEvent('onEventName', ['context' => 'com_example.example', 'subject' => $primaryKeys, 'value' => $newState]);
« More »
Class for Model event.
Example:
new BeforeDeleteEvent('onEventName', ['context' => 'com_example.example', 'subject' => $itemObjectToDelete]);
« More »
Class for Model event.
Example:
new BeforeSaveEvent('onEventName', ['context' => 'com_example.example', 'subject' => $itemObjectToSave, 'isNew' => $isNew, 'data' => $submittedData]);
« More »
Class for Model Form event.
Example:
new BeforeValidateDataEvent('onEventName', ['subject' => $form, 'data' => $data]);
« More »
Class for Model Form event.
Example:
new NormaliseRequestDataEvent('onEventName', ['context' => 'com_example.example', 'data' => $data, 'subject' => $form]);
« More »
Class for Model event.
Example:
new PrepareDataEvent('onEventName', ['context' => 'com_example.example', 'subject' => $data]);
« More »
Class for Module events.
Example:
new AfterCleanModuleListEvent('onEventName', ['subject' => $modules]);
« More »
Class for Module events.
Example:
new AfterModuleListEvent('onEventName', ['subject' => $modules]);
« More »
Class for Module events.
Example:
new AfterRenderModuleEvent('onEventName', ['subject' => $module, 'attributes' => $attrs]);
« More »
Class for Module events.
Example:
new AfterRenderModulesEvent('onEventName', ['subject' => $content, 'attributes' => $attrs]);
« More »
Class for Module events.
Example:
new BeforeRenderModuleEvent('onEventName', ['subject' => $module, 'attributes' => $attrs]);
« More »
Class for Module events.
Example:
new AfterModuleListEvent('onEventName', ['subject' => $modules]);
« More »
Concrete Event class for the onUserMultifactorBeforeDisplayMethods event
« More »
Concrete Event class for the onUserMultifactorCallback event
« More »
Concrete Event class for the onUserMultifactorCaptive event
« More »
Concrete Event class for the onUserMultifactorGetMethod event
« More »
Concrete Event class for the onUserMultifactorGetSetup event
« More »
Concrete event class for the custom events used to notify the User Action Log plugin about Two
Factor Authentication actions.
« More »
Concrete Event class for the onUserMultifactorSaveSetup event
« More »
Concrete Event class for the onUserMultifactorValidate event
« More »
Class for SchemaBeforeCompileHeadEvent event
Example:
new BeforeCompileHeadEvent('onSchemaBeforeCompileHead', ['subject' => $schema, 'context' => 'com_example.example']);
« More »
Class for SchemaPrepareDataEvent event
Example:
new PrepareDataEvent('onSchemaPrepareData', ['subject' => $data, 'context' => 'com_example.example']);
« More »
Class for SchemaPrepareSaveEvent event
Example:
new PrepareFormEvent('onSchemaPrepareForm', ['subject' => $subject, 'context' => $context, 'item' => $table, 'isNew' => $isNew, 'schema' => $schema]);
« More »
Class for Privacy events.
Example:
new CanRemoveDataEvent('onEventName', ['subject' => $requestTable, 'user' => $user]);
« More »
Class for Privacy events.
Example:
new CheckPrivacyPolicyPublishedEvent('onEventName', ['subject' => $policyInfo]);
« More »
Class for Privacy events.
Example:
new CollectCapabilitiesEvent('onEventName');
« More »
Class for Privacy events.
Example:
new ExportRequestEvent('onEventName', ['subject' => $requestTable, 'user' => $user]);
« More »
Class for Privacy events.
Example:
new RemoveDataEvent('onEventName', ['subject' => $requestTable, 'user' => $user]);
« More »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
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 »
Event class for the Table's events
« More »
Event class for \Joomla\CMS\Table\Table onAfterBind event
« More »
Event class for \Joomla\CMS\Table\Table onAfterCheckin event
« More »
Event class for \Joomla\CMS\Table\Table onAfterCheckout event
« More »
Event class for \Joomla\CMS\Table\Table onAfterDelete event
« More »
Event class for \Joomla\CMS\Table\Table onAfterHit event
« More »
Event class for \Joomla\CMS\Table\Table onAfterLoad event
« More »
Event class for \Joomla\CMS\Table\Table onAfterMove event
« More »
Event class for \Joomla\CMS\Table\Table onAfterPublish event
« More »
Event class for \Joomla\CMS\Table\Table onAfterReorder event
« More »
Event class for \Joomla\CMS\Table\Table onAfterReset event
« More »
Event class for \Joomla\CMS\Table\Table onAfterStore event
« More »
Event class for Table onBeforeBind event
« More »
Event class for \Joomla\CMS\Table\Table onBeforeCheckin event
« More »
Event class for \Joomla\CMS\Table\Table onBeforeCheckout event
« More »
Event class for \Joomla\CMS\Table\Table onBeforeDelete event
« More »
Event class for \Joomla\CMS\Table\Table onBeforeHit event
« More »
Event class for \Joomla\CMS\Table\Table onBeforeLoad event
« More »
Event class for \Joomla\CMS\Table\Table onBeforeMove event
« More »
Event class for \Joomla\CMS\Table\Table onBeforePublish event
« More »
Event class for \Joomla\CMS\Table\Table onBeforeReorder event
« More »
Event class for \Joomla\CMS\Table\Table onBeforeReset event
« More »
Event class for \Joomla\CMS\Table\Table onBeforeStore event
« More »
Event class for \Joomla\CMS\Table\Table onCheck event
« More »
Event class for \Joomla\CMS\Table\Table onObjectCreate event
« More »
Base class for User delete event
« More »
Base class for User login event
« More »
Base class for User logout event
« More »
Class for User delete event.
Example:
new AfterDeleteEvent('onEventName', ['subject' => $userArray, 'deletingResult' => $result, 'errorMessage' => $errorStr]);
« More »
Class for User event.
Example:
new AfterLoginEvent('onEventName', ['subject' => $authenticationResponseArray, 'options' => $options]);
« More »
Class for User event.
Example:
new AfterLogoutEvent('onEventName', ['subject' => $parameters, 'options' => $options]);
« More »
Class for User event.
Example:
new AfterRemindEvent('onEventName', ['subject' => $user]);
« More »
Class for User reset event.
Example:
new AfterResetCompleteEvent('onEventName', ['subject' => $user]);
« More »
Class for User reset event.
Example:
new AfterResetRequestEvent('onEventName', ['subject' => $user]);
« More »
Class for User save event.
Example:
new AfterSaveEvent('onEventName', ['subject' => $userArray, 'isNew' => $isNew, 'savingResult' => $result, 'errorMessage' => $errorStr]);
« More »
Class for User event.
Example:
new AuthenticationEvent('onEventName', ['credentials' => $credentials, 'options' => $options, 'subject' => $authenticationResponse]);
« More »
Class for User event.
Example:
new AuthorisationEvent('onEventName', ['subject' => $authenticationResponse, 'options' => $options]);
« More »
Class for User event.
Example:
new AuthorisationFailureEvent('onEventName', ['subject' => $authenticationResponseArray, 'options' => $options]);
« More »
Class for User delete event.
Example:
new BeforeDeleteEvent('onEventName', ['subject' => $userArray]);
« More »
Class for User reset event.
Example:
new BeforeResetCompleteEvent('onEventName', ['subject' => $user]);
« More »
Class for User reset event.
Example:
new BeforeResetRequestEvent('onEventName', ['subject' => $user]);
« More »
Class for User save event.
Example:
new BeforeSaveEvent('onEventName', ['subject' => $oldUserArray, 'isNew' => $isNew, 'data' => $data]);
« More »
Class for User event.
Example:
new LoginEvent('onEventName', ['subject' => $authenticationResponseArray, 'options' => $options]);
« More »
Class for User event.
Example:
new LoginFailureEvent('onEventName', ['subject' => $authenticationResponseArray, 'options' => $options]);
« More »
Class for User event.
Example:
new LogoutEvent('onEventName', ['subject' => $parameters, 'options' => $options]);
« More »
Class for User event.
Example:
new LogoutFailureEvent('onEventName', ['subject' => $parameters, 'options' => $options]);
« More »
Class for Model event.
Example:
new UserGroupAfterDeleteEvent('onEventName', ['context' => 'com_example.example', 'subject' => $itemObjectToDelete]);
« More »
Class for Model event.
Example:
new UserGroupBeforeDeleteEvent('onEventName', ['context' => 'com_example.example', 'subject' => $itemObjectToDelete]);
« More »