Documentation

GenericEvent extends Event
in package
implements ArrayAccess, IteratorAggregate

Event encapsulation class.

Encapsulates events thus decoupling the observer from the subject they encapsulate.

Tags
author

Drak drak@zikula.org

Table of Contents

Interfaces

ArrayAccess
IteratorAggregate

Properties

$arguments  : mixed
$subject  : mixed
$propagationStopped  : mixed

Methods

__construct()  : mixed
Encapsulate an event with $subject and $args.
getArgument()  : mixed
Get argument by key.
getArguments()  : array<string|int, mixed>
Getter for all arguments.
getIterator()  : ArrayIterator
IteratorAggregate for iterating over the object like an array.
getSubject()  : mixed
Getter for subject property.
hasArgument()  : bool
Has argument.
isPropagationStopped()  : bool
offsetExists()  : bool
ArrayAccess has argument.
offsetGet()  : mixed
ArrayAccess for argument getter.
offsetSet()  : void
ArrayAccess for argument setter.
offsetUnset()  : void
ArrayAccess for unset argument.
setArgument()  : $this
Add argument to event.
setArguments()  : $this
Set args property.
stopPropagation()  : mixed

Properties

$propagationStopped

private mixed $propagationStopped = false

Methods

__construct()

Encapsulate an event with $subject and $args.

public __construct([mixed $subject = null ][, array<string|int, mixed> $arguments = [] ]) : mixed
Parameters
$subject : mixed = null

The subject of the event, usually an object or a callable

$arguments : array<string|int, mixed> = []

Arguments to store in the event

getArgument()

Get argument by key.

public getArgument(string $key) : mixed
Parameters
$key : string

Key

Tags
throws
InvalidArgumentException

if key is not found

Return values
mixed

Contents of array key

getArguments()

Getter for all arguments.

public getArguments() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIterator()

IteratorAggregate for iterating over the object like an array.

public getIterator() : ArrayIterator
Attributes
#[ReturnTypeWillChange]
Return values
ArrayIterator

getSubject()

Getter for subject property.

public getSubject() : mixed
Return values
mixed

The observer subject

hasArgument()

Has argument.

public hasArgument(string $key) : bool
Parameters
$key : string

Key of arguments array

Return values
bool

isPropagationStopped()

public isPropagationStopped() : bool

since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead

Return values
bool

Whether propagation was already stopped for this event

offsetExists()

ArrayAccess has argument.

public offsetExists(string $key) : bool
Parameters
$key : string

Array key

Attributes
#[ReturnTypeWillChange]
Return values
bool

offsetGet()

ArrayAccess for argument getter.

public offsetGet(string $key) : mixed
Parameters
$key : string

Array key

Tags
throws
InvalidArgumentException

if key does not exist in $this->args

Attributes
#[ReturnTypeWillChange]

offsetSet()

ArrayAccess for argument setter.

public offsetSet(string $key, mixed $value) : void
Parameters
$key : string

Array key to set

$value : mixed

Value

Attributes
#[ReturnTypeWillChange]

offsetUnset()

ArrayAccess for unset argument.

public offsetUnset(string $key) : void
Parameters
$key : string

Array key

Attributes
#[ReturnTypeWillChange]

setArgument()

Add argument to event.

public setArgument(string $key, mixed $value) : $this
Parameters
$key : string

Argument name

$value : mixed

Value

Return values
$this

setArguments()

Set args property.

public setArguments([array<string|int, mixed> $args = [] ]) : $this
Parameters
$args : array<string|int, mixed> = []

Arguments

Return values
$this

stopPropagation()

public stopPropagation() : mixed

since Symfony 4.3, use "Symfony\Contracts\EventDispatcher\Event" instead


        
On this page

Search results