コード例 #1
0
 /**
  * {@inheritdoc}
  */
 public function reconstituteFromHistory(AggregateHistory $aggregateHistory)
 {
     $idClass = get_class($aggregateHistory->aggregateId());
     $aggregateClass = $this->mapIdClassToAggregateClass($idClass);
     /** @noinspection PhpUndefinedMethodInspection */
     return $aggregateClass::fromHistory($aggregateHistory);
 }
コード例 #2
0
 /**
  * @test
  */
 public function itExposesAnAggregateId()
 {
     $id = BasketId::fromString('some-id');
     $exposedId = $this->aggregateHistory->aggregateId();
     $this->assertTrue($id->equals($exposedId));
 }