Aggregates
Aggregate ID
Working with an Aggregate ID
<?php
use SonsOfPHP\Component\EventSourcing\Aggregate\AggregateId;
// Create a new Aggregate ID
$aggregateId = new AggregateId('my-unique-id');
// You can get the value of the ID
$id = $aggregateId->toString();
$id = (string) $aggregateId;
// To compare two Aggregate IDs
if ($aggregateId->equals($anotherAggregateId)) {
// they are the same
}Auto Generate Aggregate IDs
Aggregate Version
Working with an Aggregate Version
Creating an Aggregate
Working with Event Messages
Last updated