mrazvan92/doctrine-domain-events-bundle

With this Bundle we can send all the events which were generated by entitis at SimpleBus

dev-master 2017-06-26 14:37 UTC

This package is not auto-updated.

Last update: 2024-04-27 18:20:01 UTC


README

With this Bundle we can send all the events which were generated by entities at SimpleBus

Install

 $bundles = [
    ...
    new MR\DoctrineDomainEventsBundle\DoctrineDomainEventsBundle(),
    ...
 ];

Usage

  • after doctrine flush this event will be sent at rabbit queue
use SimpleBus\Message\Recorder\{PrivateMessageRecorderCapabilities, ContainsRecordedMessages};

class EntityName implements ContainsRecordedMessages
{
    use PrivateMessageRecorderCapabilities;

    public function __construct()
    {
        $this->record(
            new EventClass(
               'value1',
               'value2'
            )
        );
    }
}