/** * @return TodoId */ public function todoId() { if (is_null($this->todoId)) { $this->todoId = TodoId::fromString($this->aggregateId()); } return $this->todoId; }
/** * @param TodoId $other * @return bool */ public function sameValueAs(TodoId $other) { return $this->toString() === $other->toString(); }
/** * @return TodoId */ public function todoId() { return TodoId::fromString($this->payload['todo_id']); }
/** * @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()); }