ContentPrepareEvent
class ContentPrepareEvent extends ContentEvent
Class for Content event.
Example: new ContentPrepareEvent('onEventName', ['context' => 'com_example.example', 'subject' => $contentObject, 'params' => $params, 'page' => $pageNum]);
Traits
A Trait to reshape arguments maintaining b/c with legacy plugin events.
Returns the most suitable event class for a Joomla core event name
Properties
protected array
deprecated
Since: 5.0.0
|
$legacyArgumentsOrder | The argument names, in order expected by legacy plugins. |
Methods
Get the concrete event class name for the given event name.
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.
Get an event argument value.
Set the value of an event argument.
Reshape the arguments array to preserve b/c with legacy listeners
Setter for the subject argument.
Setter for the params argument.
Setter for the page argument.
Getter for the item argument.
Getter for the item argument.
Getter for the page argument.
Details
static protected string
getEventClassByEventName(string $eventName)
Get the concrete event class name for the given event name.
This method falls back to the generic Joomla\Event\Event class if the event name is unknown to this trait.
static AbstractEvent
create(string $eventName, array $arguments = [])
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.
eventClass string The Event class name. If you do not provide it Joomla\CMS\Events\
mixed
getArgument(string $name, mixed $default = null)
Get an event argument value.
It will use a pre-processing method if one exists. The method has the signature:
onGet
where:
$value is the value currently stored in the $arguments array of the event It returns the value to return to the caller.
$this
setArgument(string $name, mixed $value)
Add argument to event.
It will use a pre-processing method if one exists. The method has the signature:
onSet
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.