Skip to content

EventDispatchingDecorator

Properties

dispatcher

protected \Codefy\CommandBus\Decorators\EventDispatcher $dispatcher

innerCommandBus

protected ?\Codefy\CommandBus\CommandBus $innerCommandBus

Methods

__construct

public __construct(\Codefy\CommandBus\Decorators\EventDispatcher $dispatcher, ?\Codefy\CommandBus\CommandBus $innerCommandBus = null): mixed

Parameters:

Parameter Type Description
$dispatcher \Codefy\CommandBus\Decorators\EventDispatcher
$innerCommandBus ?\Codefy\CommandBus\CommandBus

setInnerBus

Set the CommandBus which we're decorating.

public setInnerBus(\Codefy\CommandBus\CommandBus $bus): void

Parameters:

Parameter Type Description
$bus \Codefy\CommandBus\CommandBus

execute

Execute a command and dispatch and event.

public execute(\Codefy\CommandBus\Command $command): mixed

Parameters:

Parameter Type Description
$command \Codefy\CommandBus\Command

Throws:


getEventName

Get the event name for a given Command.

protected getEventName(\Codefy\CommandBus\Command $command): string

Parameters:

Parameter Type Description
$command \Codefy\CommandBus\Command


Automatically generated on 2025-10-13