Exemplo n.º 1
0
 /**
  * Factory method to create an Marriage.
  */
 public static function createMarriage($marriageId, $partners, $occurredOn)
 {
     $marriage = new Marriage();
     // After instantiation of the object we apply the "MarriageCreatedEvent".
     $marriage->apply(new MarriageCreatedEvent($marriageId, $partners, $occurredOn));
     return $marriage;
 }