Since: 4.0.0

class BeforeResetEvent extends AbstractEvent

Event class for \Joomla\CMS\Table\Table onBeforeReset event

Traits

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

Methods

static string
getEventClassByEventName(string $eventName)

Get the concrete event class name for the given event name.

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.

__construct(string $name, array $arguments = [])

No description

mixed
getArgument(string $name, mixed $default = null)

Get an event argument value.

$this
setArgument(string $name, mixed $value)

Add argument to event.

void
offsetSet(string $name, mixed $value)

Set the value of an event argument.

void
offsetUnset(string $name)

Remove an event argument.

setSubject(TableInterface $value) deprecated

Setter for the subject argument

onSetSubject(TableInterface $value)

Setter for the subject argument

Details

static protected string getEventClassByEventName(string $eventName)

Since: 4.2.0

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.

Parameters

string $eventName

The event name

Return Value

string

The event class name

static AbstractEvent create(string $eventName, array $arguments = [])

Since: 4.0.0

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\ will be used.

Parameters

string $eventName

The name of the event, e.g. onTableBeforeLoad

array $arguments

Additional arguments to pass to the event

Return Value

AbstractEvent

Exceptions

BadMethodCallException

__construct(string $name, array $arguments = [])

Since: 1.0

No description

Parameters

string $name

The event name.

array $arguments

The event arguments.

Exceptions

BadMethodCallException

mixed getArgument(string $name, mixed $default = null)

Since: 4.0.0

Get an event argument value.

It will use a pre-processing method if one exists. The method has the signature:

onGet($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.

Parameters

string $name

The argument name.

mixed $default

The default value if not found.

Return Value

mixed

The argument value or the default value.

$this setArgument(string $name, mixed $value)

Since: 4.0.0

Add argument to event.

It will use a pre-processing method if one exists. The method has the signature:

onSet($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.

Parameters

string $name

Argument name.

mixed $value Value.

Return Value

$this

void offsetSet(string $name, mixed $value)

Since: 4.0.0

Set the value of an event argument.

Parameters

string $name

The argument name.

mixed $value

The argument value.

Return Value

void

Exceptions

BadMethodCallException

void offsetUnset(string $name)

Since: 4.0.0

Remove an event argument.

Parameters

string $name

The argument name.

Return Value

void

Exceptions

BadMethodCallException

protected TableInterface setSubject(TableInterface $value) deprecated

deprecated 4.4.0 will be removed in 6.0 Use counterpart with onSet prefix

Setter for the subject argument

Parameters

TableInterface $value

The value to set

Return Value

TableInterface

Exceptions

BadMethodCallException

protected TableInterface onSetSubject(TableInterface $value)

Since: 4.4.0

Setter for the subject argument

Parameters

TableInterface $value

The value to set

Return Value

TableInterface

Exceptions

BadMethodCallException