Consider the following use case:
So in order to make this work, you need 3 small changes in your application.
Step 1: Create a UserAggregateTranslator
Step 2: Change the assertion method in the EventStoreUserCollection
Step 3: Make use of your custom AggregateTranslator
If you use the provided container factory (\Prooph\EventStore\Container\Aggregate\AbstractAggregateRepositoryFactory) then you can also just change the
aggregate_translatorkey in your config to point to the new
UserAggregateTranslatorand register the
UserAggregateTranslatorin your container.