Ejemplo n.º 1
0
 /**
  * @param UserId $assigneeId
  * @param string $text
  * @param TodoId $todoId
  * @param TodoStatus $todoStatus
  * @return TodoWasPosted
  */
 public static function byUser(UserId $assigneeId, $text, TodoId $todoId, TodoStatus $todoStatus)
 {
     $event = self::occur($todoId->toString(), ['assignee_id' => $assigneeId->toString(), 'text' => $text, 'status' => $todoStatus->toString()]);
     $event->todoId = $todoId;
     $event->assigneeId = $assigneeId;
     $event->todoStatus = $todoStatus;
     return $event;
 }
Ejemplo n.º 2
0
 /**
  * @param TodoId $other
  * @return bool
  */
 public function sameValueAs(TodoId $other)
 {
     return $this->toString() === $other->toString();
 }
Ejemplo n.º 3
0
 /**
  * @return string representation of the unique identifier of the aggregate root
  */
 protected function aggregateId()
 {
     return $this->todoId->toString();
 }
 /**
  * @param TodoId $todoId
  * @return Todo
  */
 public function get(TodoId $todoId)
 {
     return $this->getAggregateRoot($todoId->toString());
 }