user = $user; $this->code = md5(random_bytes(100)); } public function getId(): int { return $this->id; } public function getUser(): User { return $this->user; } public function getCode(): string { return $this->code; } public function getUsedBy(): ?User { return $this->usedBy; } }