public function setId(UUID $id) { if ($this->id !== null) { throw new \InvalidStateException("Id is already set"); } $this->id = $id; }