andreo / eventsauce-aggregate
Extended aggregate components for EventSauce.
3.1
2023-03-27 18:44 UTC
Requires
- php: >=8.2
- eventsauce/eventsauce: ^3.0
Requires (Dev)
- eventsauce/test-utilities: ^3.0.0
- eventsauce/uuid-encoding: ^0.3.0
- phpstan/phpstan: ^1.3
- phpunit/phpunit: ^9.4
- roave/security-advisories: dev-latest
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 { } }