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');
$this->addType('completionExpectedAt', 'datetime');
}
public function toRow(): array {
return array_combine(self::$columns, array_map(function ($field) {
return $this->{'get'.ucfirst($field)}();
}, self::$fields));
}
public static function fromPublicTask(OCPTask $task): Task {
/** @var Task $task */
$task = 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(),
'completionExpectedAt' => $task->getCompletionExpectedAt(),
]);
return $task;
}
public function toPublicTask(): OCPTask {
$task = new OCPTask($this->getType(), $this->getInput(), $this->getAppId(), $this->getuserId(), $this->getIdentifier());
$task->setId($this->getId());
$task->setStatus($this->getStatus());
$task->setOutput($this->getOutput());
$task->setCompletionExpectedAt($this->getCompletionExpectedAt());
return $task;
}
}
ile-from-and-to-a-shared-folder'>add-integration-tests-for-moving-a-file-from-and-to-a-shared-folder
Nextcloud server, a safe home for all your data: https://github.com/nextcloud/server | www-data |
blob: 7c2a290bd1d1c4e3aae9dae91779887ebe065351 (
plain)