EventImmutable

Extends AbstractEvent

Implementation of an immutable Event.

final

An immutable event cannot be modified after instantiation :

  • its propagation cannot be stopped
  • its arguments cannot be modified

You may want to use this event when you want to ensure that the listeners won't manipulate it.

since

1.0

package

Joomla Framework

Methods

__construct

Constructor.

__construct( name, mixed||string|int arguments = []) : 
throws

BadMethodCallException

since

1.0

Arguments

name

stringThe event name.

arguments

array<string|int, mixed>The event arguments.

Response

mixed

__serialize

Serialize the event.

__serialize() : mixed||string|int
inherited
since

2.0.0

Response

array<string|int, mixed>The data to be serialized

__unserialize

Unserialize the event.

__unserialize(mixed||string|int data) : 
inherited
since

2.0.0

Arguments

data

array<string|int, mixed>The serialized event.

Response

void

count

Count the number of arguments.

count() : 
inherited
since

1.0

Response

intThe number of arguments.

getArgument

Get an event argument value.

getArgument( name,  default = null) : 
inherited
since

1.0

Arguments

name

stringThe argument name.

default

mixedThe default value if not found.

Response

mixedThe argument value or the default value.

getArguments

Get all event arguments.

getArguments() : mixed||string|int
inherited
since

1.0

Response

array<string|int, mixed>An associative array of argument names as keys and their values as values.

getName

Get the event name.

getName() : 
inherited
since

1.0

Response

stringThe event name.

hasArgument

Tell if the given event argument exists.

hasArgument( name) : 
inherited
since

1.0

Arguments

name

stringThe argument name.

Response

boolTrue if it exists, false otherwise.

isStopped

Tell if the event propagation is stopped.

isStopped() : 
inherited
since

1.0

Response

boolTrue if stopped, false otherwise.

offsetExists

Tell if the given event argument exists.

offsetExists( name) : 
inherited
since

1.0

Arguments

name

stringThe argument name.

Response

boolTrue if it exists, false otherwise.

offsetGet

Get an event argument value.

offsetGet( name) : 
inherited
since

1.0

Arguments

name

stringThe argument name.

Response

mixedThe argument value or null if not existing.

offsetSet

Set the value of an event argument.

offsetSet( name,  value) : 
since

1.0

throws

BadMethodCallException

Arguments

name

stringThe argument name.

value

mixedThe argument value.

Response

void

offsetUnset

Remove an event argument.

offsetUnset( name) : 
throws

BadMethodCallException

since

1.0

Arguments

name

stringThe argument name.

Response

void

serialize

Serialize the event.

serialize() : 
inherited
since

1.0

Response

stringThe serialized event.

stopPropagation

Stops the propagation of the event to further event listeners.

stopPropagation() : 
inherited
since

2.0.0

Response

void

unserialize

Unserialize the event.

unserialize( serialized) : 
inherited
since

1.0

Arguments

serialized

stringThe serialized event.

Response

void

Properties

name

The event name.

inherited
since

1.0

Type(s)

string

arguments

The event arguments.

inherited
since

1.0

Type(s)

array<string|int, mixed>

stopped

A flag to see if the event propagation is stopped.

inherited
since

1.0

Type(s)

bool

constructed

A flag to see if the constructor has been already called.

Type(s)

bool