EventDispatcher Class

Aurora\Events Namespace


Properties

provider

Listener provider

protected $provider: \ListenerProviderInterface

Constructor

__construct

Constructor

Parameters

  • Psr\EventDispatcher\ListenerProviderInterface $provider — Listener provider

Signature

public function __construct(Psr\EventDispatcher\ListenerProviderInterface $provider)

Methods

__construct

Constructor

Parameters

  • Psr\EventDispatcher\ListenerProviderInterface $provider — Listener provider

Signature

public function __construct(Psr\EventDispatcher\ListenerProviderInterface $provider)

getProvider

Get listener provider

Return Value

  • \ListenerProviderInterface Listener provider

Signature

public function getProvider(): Psr\EventDispatcher\ListenerProviderInterface

listen

Add a listener

Parameters

  • string $event — Event class
  • mixed $handler — Event handler
  • int $priority — Handler priority

Signature

public function listen(string $event, mixed $handler, int $priority = 50)

dispatch

Provide all relevant listeners with an event to process

Parameters

  • object $event — The object to process

Return Value

  • object

Signature

public function dispatch(object $event): object

Go to top