/** * @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; }
/** * @param TodoId $other * @return bool */ public function sameValueAs(TodoId $other) { return $this->toString() === $other->toString(); }
/** * @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()); }