/**
  * @throws AmbiguousAggregateIdentifierException
  * @throws NoAggregateIdentifierException
  */
 private function readAnnotatedAggregateIdentifier()
 {
     $reader = new AggregateIdentifierAnnotationReader($this);
     $annotations = $reader->readAll();
     if (empty($annotations)) {
         throw new NoAggregateIdentifierException($this);
     }
     if (count($annotations) > 1) {
         throw new AmbiguousAggregateIdentifierException($this);
     }
     $this->aggregateIdentifier = $annotations[0];
 }
 /**
  * @test
  * @expectedException \Doctrine\Common\Annotations\AnnotationException
  */
 public function readAllThrowsExceptionIfAggregateIdentifierTypeIsMissing()
 {
     $aggregate = AggregateIdentifierAnnotationReaderTest_AggregateRootWithoutType::reconstruct(new Events());
     $reader = new AggregateIdentifierAnnotationReader($aggregate);
     $reader->readAll();
 }