PreprocessMenuItemsEvent
Extends AbstractImmutableEventClass for menu events
| since |
5.0.0 |
|---|---|
| package |
Joomla CMS |
Methods
__construct
Constructor.
__construct( name, mixed||string|int arguments = []) :
| throws |
|
|---|---|
| since |
5.0.0 |
Arguments
- name
stringThe event name.- arguments
array<string|int, mixed>The event arguments.
Response
mixed
create
Creates a new CMS event object for a given event name and subject. The following arguments must be given: subject object The subject of the event. This is the core object you are going to manipulate.
create( eventName, mixed||string|int arguments = []) :
eventClass string The Event class name. If you do not provide it Joomla\CMS\Events<eventNameWithoutOnPrefix> will be used.
| since |
4.0.0 |
|---|---|
| throws |
|
Arguments
- eventName
stringThe name of the event, e.g. onTableBeforeLoad- arguments
array<string|int, mixed>Additional arguments to pass to the event
Response
static
getArgument
Get an event argument value.
getArgument( name, default = null) :
It will use a pre-processing method if one exists. The method has the signature:
onGet<ArgumentName>($value): mixed
where:
$value is the value currently stored in the $arguments array of the event It returns the value to return to the caller.
| since |
4.0.0 |
|---|
Arguments
- name
stringThe argument name.- default
mixedThe default value if not found.
Response
mixedThe argument value or the default value.
getContext
Getter for the context.
getContext() :
| since |
5.0.0 |
|---|
Response
string
getEnabled
Getter for the enabled.
getEnabled() : bool
| since |
5.0.0 |
|---|
Response
bool|null
getEventClassByEventName
Get the concrete event class name for the given event name.
getEventClassByEventName( eventName) :
This method falls back to the generic Joomla\Event\Event class if the event name is unknown to this trait.
| since |
4.2.0 |
|---|
Arguments
- eventName
stringThe event name
Response
stringThe event class name
getItems
Getter for the items.
getItems() : \Joomla\CMS\Menu\MenuItem||string|int
getParams
Getter for the params.
getParams() : \Joomla\Registry\Registry
| since |
5.0.0 |
|---|
Response
Registry|null
offsetSet
Set the value of an event argument.
offsetSet( name, value) :
| since |
4.0.0 |
|---|---|
| throws |
|
Arguments
- name
stringThe argument name.- value
mixedThe argument value.
Response
void
offsetUnset
Remove an event argument.
offsetUnset( name) :
| since |
4.0.0 |
|---|---|
| throws |
|
Arguments
- name
stringThe argument name.
Response
void
onSetContext
Setter for the context argument.
onSetContext( value) :
| since |
5.0.0 |
|---|
Arguments
- value
stringThe value to set
Response
string
onSetEnabled
Setter for the enabled argument.
onSetEnabled(bool value) : bool
| since |
5.0.0 |
|---|
Arguments
- value
bool|nullThe value to set
Response
bool|null
onSetParams
Setter for the registry argument.
onSetParams(\Joomla\Registry\Registry value) : \Joomla\Registry\Registry
| since |
5.0.0 |
|---|
Arguments
- value
Registry|nullThe value to set
Response
Registry|null
onSetSubject
Setter for the subject argument.
onSetSubject(\Joomla\CMS\Menu\MenuItem||string|int value) : \Joomla\CMS\Menu\MenuItem||string|int
reshapeArguments
Reshape the arguments array to preserve b/c with legacy listeners
reshapeArguments(mixed||string|int arguments, mixed||string|int argumentNames, mixed||string|int defaults = []) : mixed||string|int
| since |
4.2.0 |
|---|
Arguments
- arguments
array<string|int, mixed>The named arguments array passed to the constructor.- argumentNames
array<string|int, mixed>The allowed argument names (mandatory AND optional).- defaults
array<string|int, mixed>Default values for optional arguments.
Response
array<string|int, mixed>The reshaped arguments.
setArgument
Add argument to event.
setArgument( name, value) :
It will use a pre-processing method if one exists. The method has the signature:
onSet<ArgumentName>($value): mixed
where:
$value is the value being set by the user It returns the value to return to set in the $arguments array of the event.
| since |
4.0.0 |
|---|
Arguments
- name
stringArgument name.- value
mixedValue.
Response
$this
updateItems
Update the items.
updateItems(\Joomla\CMS\Menu\MenuItem||string|int value) :
Properties
eventNameToConcreteClass
Maps event names to concrete Event classes.
This is only for events with invariable names. Events with variable names are handled with PHP logic in the getEventClassByEventName class.
| since |
4.2.0 |
|---|
Type(s)
array<string|int, mixed>
legacyArgumentsOrder
The argument names, in order expected by legacy plugins.
| since |
5.0.0 |
|---|---|
| deprecated |
5.0 will be removed in 7.0 |
Type(s)
array<string|int, mixed>