Skip to content

Instantly share code, notes, and snippets.

@fritz-gerneth
Last active September 5, 2018 11:59
Show Gist options
  • Save fritz-gerneth/21f725c7550e855e2640dfd9686a2dcb to your computer and use it in GitHub Desktop.
Save fritz-gerneth/21f725c7550e855e2640dfd9686a2dcb to your computer and use it in GitHub Desktop.
<?php
final class SyncedIdentityRepository extends AggregateRepository
{
public function get(ExternalId $id)
{
$aggregate = $this->getAggregateRoot($id->__toString());
if (null === $aggregate) {
$aggregate = new SyncedIdentity::create($id);
}
return $aggregate;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment