interface CommandHookInterface (View source)

Contract for a hook that is invoked just before any command is processed via {ContentRepository::handle()}

A command hook can be used to replace/alter an incoming command before it is being passed to the corresponding {\Neos\ContentRepository\Core\CommandHandler\CommandHandlerInterface}. This can be used to change or enrich the payload of the command. A command hook can also be used to intercept commands based on their type or payload but this is not the intended use case because it can lead to a degraded user experience

Methods

onAfterHandle(CommandInterface $command, PublishedEvents $events)

No description

Details

CommandInterface onBeforeHandle(CommandInterface $command)

No description

Parameters

CommandInterface $command

The command that is about to be handled

Return Value

CommandInterface

This hook must return a command instance. It can be the unaltered incoming $command or a new instance

Commands onAfterHandle(CommandInterface $command, PublishedEvents $events)

No description

Parameters

CommandInterface $command

The command that was just handled

PublishedEvents $events

The events that resulted from the handled command

Return Value

Commands

This hook must return Commands that will be handled after the incoming $command. The Commands can be empty.