andreo/eventsauce-aggregate

EventSauce 的扩展聚合组件

3.1 2023-03-27 18:44 UTC

This package is auto-updated.

Last update: 2024-09-27 21:50:06 UTC


README

EventSauce 的扩展聚合组件

安装

composer require andreo/eventsauce-aggregate

基于属性处理聚合事件

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
    {
    }
}