misc_pterodactyl-panel/app/Transformers/Api/Client/TaskTransformer.php

30 lines
830 B
PHP
Raw Permalink Normal View History

2020-02-08 23:23:08 +00:00
<?php
namespace Pterodactyl\Transformers\Api\Client;
use Pterodactyl\Models\Task;
use Pterodactyl\Transformers\Api\Transformer;
2020-02-08 23:23:08 +00:00
class TaskTransformer extends Transformer
2020-02-08 23:23:08 +00:00
{
public function getResourceName(): string
{
return Task::RESOURCE_NAME;
}
public function transform(Task $model): array
2020-02-08 23:23:08 +00:00
{
return [
'id' => $model->id,
'sequence_id' => $model->sequence_id,
'action' => $model->action,
'payload' => $model->payload,
'time_offset' => $model->time_offset,
'is_queued' => $model->is_queued,
'continue_on_failure' => $model->continue_on_failure,
'created_at' => self::formatTimestamp($model->created_at),
'updated_at' => self::formatTimestamp($model->updated_at),
2020-02-08 23:23:08 +00:00
];
}
}