Working with Aggregates
Working with Event Sourcing Aggregates
#[EventSourcingAggregate]
class Product
{
use WithAggregateVersioning;
#[Identifier]
private string $id;
#[CommandHandler]
public static function create(CreateProduct $command) : array
{
return [new ProductWasCreated($command->id, $command->name, $command->price)];
}
}
Event Stream
Aggregate Version
Aggregate Id (Partition Key)
Aggregate Type
Recording Events in the Event Stream
Last updated
Was this helpful?