-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
clean-up aggregate id implementation
- Loading branch information
1 parent
59b7587
commit 4838498
Showing
41 changed files
with
138 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -103,9 +103,9 @@ After the events have been written, | |
the new events are dispatched on the [event bus](./event_bus.md). | ||
|
||
```php | ||
use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; | ||
use Patchlevel\EventSourcing\Aggregate\Uuid; | ||
|
||
$id = UuidAggregateRootId::generate(); | ||
$id = Uuid::v7(); | ||
$profile = Profile::create($id, '[email protected]'); | ||
|
||
$repository->save($profile); | ||
|
@@ -126,9 +126,9 @@ An `aggregate` can be loaded using the `load` method. | |
All events for the aggregate are loaded from the database and the current state is rebuilt. | ||
|
||
```php | ||
use Patchlevel\EventSourcing\Aggregate\UuidAggregateRootId; | ||
use Patchlevel\EventSourcing\Aggregate\Uuid; | ||
|
||
$id = UuidAggregateRootId::fromString('229286ff-6f95-4df6-bc72-0a239fe7b284'); | ||
$id = Uuid::fromString('229286ff-6f95-4df6-bc72-0a239fe7b284'); | ||
$profile = $repository->load($id); | ||
``` | ||
|
||
|
@@ -147,7 +147,7 @@ You can also check whether an `aggregate` with a certain id exists. | |
It is checked whether any event with this id exists in the database. | ||
|
||
```php | ||
$id = UuidAggregateRootId::fromString('229286ff-6f95-4df6-bc72-0a239fe7b284'); | ||
$id = Uuid::fromString('229286ff-6f95-4df6-bc72-0a239fe7b284'); | ||
|
||
if($repository->has($id)) { | ||
// ... | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.