symfony-notes/command-bus-bundle

This package is abandoned and no longer maintained. No replacement package was suggested.

Symfony Command Bus Bundle

dev-master / 1.x-dev 2017-04-25 09:34 UTC

This package is auto-updated.

Last update: 2023-01-27 20:47:53 UTC


README

This bundle will help you to use Command Query Responsibility Segregation

Please see CQRS

SensioLabsInsight

License

Installation

  • Require the bundle with composer:
composer require symfony-notes/command-bus-bundle
  • Enable the bundle in the kernel:
public function registerBundles()
{
    $bundles = [
        // ...
        new SymfonyNotes\CommandBusBundle\SymfonyNotesCommandBusBundle(),
        // ...
    ];
    ...
}

How to use?

  • Command class
class YourCommand implements CommandInterface
{
    public $id;
}
  • Command Handler class
class CreateFaceHandler implements CommandHandlerInterface
{
    public function handle(CommandInterface $command)
    {
        ...
    }
}
  • Call command bus
$this->get('notes.command_bus')->handle($command);