ICanBoogie/Event v1.3.3
  • Namespace
  • Class

Namespaces

  • ICanBoogie
    • Event

Classes

  • Event
  • EventHook
  • Events

Class Event

An event.

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

Methods summary

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
# 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

public static array $profiling

Profiling information about events.

Profiling information about events.

# [ 'hooks' => [], 'unused' => [] ]

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 v1.3.3 API documentation generated by ApiGen