Example #1
0
 /**
  * Handles construction from a serialized representation
  *
  * @param string $serialized The serialized representation
  *
  * @return void
  */
 public function unserialize($serialized)
 {
     $data = unserialize($serialized);
     $this->aggregateId = $data['aggregate_id'];
     $this->aggregateType = $data['aggregate_type'];
     $this->committedSequence = $data['committed_sequence'];
     $this->lastSequence = $data['last_sequence'];
     $this->messages = ArrayList::of(EventMessage::class);
     foreach ($data['messages'] as $message) {
         $this->messages->add($message);
     }
 }