andreo/eventsauce-aggregate

Extended aggregate components for EventSauce.

3.1 2023-03-27 18:44 UTC

This package is auto-updated.

Last update: 2024-10-27 22:01:27 UTC


README

Extended aggregate components for EventSauce

Installation

composer require andreo/eventsauce-aggregate

Handle aggregate event based on an attribute

use EventSauce\EventSourcing\AggregateRoot;
use Andreo\EventSauce\Aggregate\Reconstruction\EventSourcingHandler;
use Andreo\EventSauce\Aggregate\Reconstruction\AggregateRootBehaviourWithAppliesEventsByAttribute;

final class FooAggregate implements AggregateRoot
{
    use AggregateRootBehaviourWithAppliesEventsByAttribute;
    
    #[EventSourcingHandler]
    public function onFooInitiated(FooInitiated $event): void
    {
    }
}