aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMarcel Klehr <mklehr@gmx.net>2023-10-20 13:54:36 +0200
committerMarcel Klehr <mklehr@gmx.net>2023-10-20 13:54:36 +0200
commit9ee72633cf78a777756d2d4afe707f2539521ccc (patch)
tree68a524cfb385a63311cf71003ad433e2b6a76a9f /lib/private
parent4c58edc1b7fcc042c1cff1f1123732d8526565be (diff)
downloadnextcloud-server-9ee72633cf78a777756d2d4afe707f2539521ccc.tar.gz
nextcloud-server-9ee72633cf78a777756d2d4afe707f2539521ccc.zip
enh(Text2Image): Expose expected completion time
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/TextToImage/Db/Task.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/private/TextToImage/Db/Task.php b/lib/private/TextToImage/Db/Task.php
index 8d857ce47ea..312ed07880b 100644
--- a/lib/private/TextToImage/Db/Task.php
+++ b/lib/private/TextToImage/Db/Task.php
@@ -46,6 +46,8 @@ use OCP\TextToImage\Task as OCPTask;
* @method string|null getIdentifier()
* @method setNumberOfImages(int $numberOfImages)
* @method int getNumberOfImages()
+ * @method setCompletionExpectedAt(DateTime $at)
+ * @method DateTime getCompletionExpectedAt()
*/
class Task extends Entity {
protected $lastUpdated;
@@ -56,16 +58,17 @@ class Task extends Entity {
protected $appId;
protected $identifier;
protected $numberOfImages;
+ protected $completionExpectedAt;
/**
* @var string[]
*/
- public static array $columns = ['id', 'last_updated', 'input', 'status', 'user_id', 'app_id', 'identifier', 'number_of_images'];
+ public static array $columns = ['id', 'last_updated', 'input', 'status', 'user_id', 'app_id', 'identifier', 'number_of_images', 'completion_expected_at'];
/**
* @var string[]
*/
- public static array $fields = ['id', 'lastUpdated', 'input', 'status', 'userId', 'appId', 'identifier', 'numberOfImages'];
+ public static array $fields = ['id', 'lastUpdated', 'input', 'status', 'userId', 'appId', 'identifier', 'numberOfImages', 'completionExpectedAt'];
public function __construct() {
@@ -78,6 +81,7 @@ class Task extends Entity {
$this->addType('appId', 'string');
$this->addType('identifier', 'string');
$this->addType('numberOfImages', 'integer');
+ $this->addType('completionExpectedAt', 'datetime');
}
public function toRow(): array {
@@ -97,6 +101,7 @@ class Task extends Entity {
'userId' => $task->getUserId(),
'appId' => $task->getAppId(),
'identifier' => $task->getIdentifier(),
+ 'completionExpectedAt' => $task->getCompletionExpectedAt(),
]);
return $dbTask;
}
@@ -105,6 +110,7 @@ class Task extends Entity {
$task = new OCPTask($this->getInput(), $this->getAppId(), $this->getNumberOfImages(), $this->getuserId(), $this->getIdentifier());
$task->setId($this->getId());
$task->setStatus($this->getStatus());
+ $task->setCompletionExpectedAt($this->getCompletionExpectedAt());
return $task;
}
}