4545 * @method int getStartedAt()
4646 * @method setEndedAt(int $endedAt)
4747 * @method int getEndedAt()
48+ * @method setCleanup(int $cleanup)
49+ * @method int getCleanup()
4850 */
4951class Task extends Entity {
5052 protected $ lastUpdated ;
@@ -63,16 +65,17 @@ class Task extends Entity {
6365 protected $ scheduledAt ;
6466 protected $ startedAt ;
6567 protected $ endedAt ;
68+ protected $ cleanup ;
6669
6770 /**
6871 * @var string[]
6972 */
70- public static array $ columns = ['id ' , 'last_updated ' , 'type ' , 'input ' , 'output ' , 'status ' , 'user_id ' , 'app_id ' , 'custom_id ' , 'completion_expected_at ' , 'error_message ' , 'progress ' , 'webhook_uri ' , 'webhook_method ' , 'scheduled_at ' , 'started_at ' , 'ended_at ' ];
73+ public static array $ columns = ['id ' , 'last_updated ' , 'type ' , 'input ' , 'output ' , 'status ' , 'user_id ' , 'app_id ' , 'custom_id ' , 'completion_expected_at ' , 'error_message ' , 'progress ' , 'webhook_uri ' , 'webhook_method ' , 'scheduled_at ' , 'started_at ' , 'ended_at ' , ' cleanup ' ];
7174
7275 /**
7376 * @var string[]
7477 */
75- public static array $ fields = ['id ' , 'lastUpdated ' , 'type ' , 'input ' , 'output ' , 'status ' , 'userId ' , 'appId ' , 'customId ' , 'completionExpectedAt ' , 'errorMessage ' , 'progress ' , 'webhookUri ' , 'webhookMethod ' , 'scheduledAt ' , 'startedAt ' , 'endedAt ' ];
78+ public static array $ fields = ['id ' , 'lastUpdated ' , 'type ' , 'input ' , 'output ' , 'status ' , 'userId ' , 'appId ' , 'customId ' , 'completionExpectedAt ' , 'errorMessage ' , 'progress ' , 'webhookUri ' , 'webhookMethod ' , 'scheduledAt ' , 'startedAt ' , 'endedAt ' , ' cleanup ' ];
7679
7780
7881 public function __construct () {
@@ -94,6 +97,7 @@ public function __construct() {
9497 $ this ->addType ('scheduledAt ' , 'integer ' );
9598 $ this ->addType ('startedAt ' , 'integer ' );
9699 $ this ->addType ('endedAt ' , 'integer ' );
100+ $ this ->addType ('cleanup ' , 'integer ' );
97101 }
98102
99103 public function toRow (): array {
@@ -122,6 +126,7 @@ public static function fromPublicTask(OCPTask $task): self {
122126 'scheduledAt ' => $ task ->getScheduledAt (),
123127 'startedAt ' => $ task ->getStartedAt (),
124128 'endedAt ' => $ task ->getEndedAt (),
129+ 'cleanup ' => $ task ->getCleanup (),
125130 ]);
126131 return $ taskEntity ;
127132 }
@@ -144,6 +149,7 @@ public function toPublicTask(): OCPTask {
144149 $ task ->setScheduledAt ($ this ->getScheduledAt ());
145150 $ task ->setStartedAt ($ this ->getStartedAt ());
146151 $ task ->setEndedAt ($ this ->getEndedAt ());
152+ $ task ->setCleanup ($ this ->getCleanup () !== 0 );
147153 return $ task ;
148154 }
149155}
0 commit comments