title = $title; $this->user_text = $userText; } public function setId(?int $id): TextPrompt { $this->id = $id; return $this; } public function getTitle(): string { return $this->title ?? ''; } public function getId(): ?int { return $this->id; } public function getUserText(): ?string { return $this->user_text; } public function offsetExists(mixed $offset): bool { return isset($this->{$offset}); } public function offsetGet(mixed $offset): mixed { return $this->{$offset}; } public function offsetSet(mixed $offset, mixed $value): void { } public function offsetUnset(mixed $offset): void { } public static function fromArray(array $promptRow) { $entity = new self($promptRow['title'] ?? null, $promptRow['user_text'] ?? null); return $entity->setId($promptRow['id'] ?? null); } }