interface CommandHandlerInterface (View source)

internal  no public API, because commands are no extension points of the CR
 

Common interface for all Content Repository command handlers

The {\Neos\ContentRepository\Core\CommandHandler\CommandHandlingDependencies} are available during handling to do soft-constraint checks

Methods

handle(CommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies)

"simple" command handlers return EventsToPublish directly

Details

bool canHandle(CommandInterface|RebasableToOtherWorkspaceInterface $command)

No description

Parameters

CommandInterface|RebasableToOtherWorkspaceInterface $command

Return Value

bool

EventsToPublish|Generator handle(CommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies)

"simple" command handlers return EventsToPublish directly

For the case of the workspace command handler that need to publish to many streams and "close" the content-stream directly, it's allowed to yield the events to interact with the control flow of event publishing.

Parameters

CommandInterface|RebasableToOtherWorkspaceInterface $command
CommandHandlingDependencies $commandHandlingDependencies

Return Value

EventsToPublish|Generator