ICanBoogie/Event master
  • Namespace
  • Class

Namespaces

  • ICanBoogie

Classes

  • Event
  • EventCollection
  • EventCollectionProvider
  • EventHook
  • EventHookReflection
  • EventProfiler
  • EventReflection

Functions

  • get_events

Class Event

An event.

ICanBoogie\Event uses ICanBoogie\Accessor\AccessorTrait (not available)
Namespace: ICanBoogie
Located at Event.php

Methods summary

public static ICanBoogie\Event
# from( array $params )

Returns an unfired, initialized event.

Returns an unfired, initialized event.

Parameters

$params

Returns

ICanBoogie\Event

See

EventReflection::from
protected
# get_stopped( )
protected
# get_used_by( )
protected
# get_used( )
protected
# get_target( )
public
# __construct( mixed $target, string $type, array $payload = [] )

Creates an event and fires it immediately.

Creates an event and fires it immediately.

If the event's target is specified its class is used to prefix the event type. For example, if the event's target is an instance of ICanBoogie\Operation and the event type is process the final event type will be ICanBoogie\Operation::process.

Parameters

$target
The target of the event.
$type
The event type.
$payload
Event payload.

Throws

PropertyIsReserved
in attempt to specify a reserved property with the payload.
public
# fire( )

Fires the event.

Fires the event.

public
# stop( )

Stops the hooks chain.

Stops the hooks chain.

After the stop() method is called the hooks chain is broken and no other hook is called.

public ICanBoogie\Event
# chain( callable $hook )

Add an event hook to the finish chain.

Add an event hook to the finish chain.

The finish chain is executed after the event chain was traversed without being stopped.

Parameters

$hook

Returns

ICanBoogie\Event

Properties summary

Magic properties

public read-only $stopped

bool true when the event was stopped, false otherwise.

public read-only $used

int The number of event hooks that were invoked while dispatching the event.

public read-only $used_by

array Event hooks that were invoked while dispatching the event.

public read-only $target

mixed The object the event is dispatched on.

ICanBoogie/Event master API documentation generated by ApiGen