addType('id', 'integer'); $this->addType('lastUpdated', 'integer'); $this->addType('type', 'string'); $this->addType('input', 'string'); $this->addType('output', 'string'); $this->addType('status', 'integer'); $this->addType('userId', 'string'); $this->addType('appId', 'string'); $this->addType('identifier', 'string'); } public function toRow(): array { return array_combine(self::$columns, array_map(function ($field) { return $this->{'get'.ucfirst($field)}(); }, self::$fields)); } public static function fromLanguageModelTask(ILanguageModelTask $task): Task { return Task::fromParams([ 'id' => $task->getId(), 'type' => $task->getType(), 'lastUpdated' => time(), 'status' => $task->getStatus(), 'input' => $task->getInput(), 'output' => $task->getOutput(), 'userId' => $task->getUserId(), 'appId' => $task->getAppId(), 'identifier' => $task->getIdentifier(), ]); } }