Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/app/Transformers/Api/Client/TaskTransformer.php
10287 views
1
<?php
2
3
namespace Pterodactyl\Transformers\Api\Client;
4
5
use Pterodactyl\Models\Task;
6
7
class TaskTransformer extends BaseClientTransformer
8
{
9
public function getResourceName(): string
10
{
11
return Task::RESOURCE_NAME;
12
}
13
14
/**
15
* Transforms a schedule's task into a client viewable format.
16
*/
17
public function transform(Task $model): array
18
{
19
return [
20
'id' => $model->id,
21
'sequence_id' => $model->sequence_id,
22
'action' => $model->action,
23
'payload' => $model->payload,
24
'time_offset' => $model->time_offset,
25
'is_queued' => $model->is_queued,
26
'continue_on_failure' => $model->continue_on_failure,
27
'created_at' => $model->created_at->toAtomString(),
28
'updated_at' => $model->updated_at->toAtomString(),
29
];
30
}
31
}
32
33