Example #1
0
 /**
  * @param string $text
  * @param string $email
  * @return Post
  */
 public static function create($text, $email)
 {
     $self = new self();
     $self->recordThat(PostCreated::with(['post_id' => Uuid::uuid4()->toString(), 'text' => $text, 'email' => $email], $self->nextVersion()));
     return $self;
 }
Example #2
0
 /**
  * @param string $name
  * @param string $email
  * @return User
  */
 public static function create($name, $email)
 {
     $self = new self();
     $self->recordThat(UserCreated::with(['user_id' => Uuid::uuid4()->toString(), 'name' => $name, 'email' => $email], $self->nextVersion()));
     return $self;
 }